summaryrefslogtreecommitdiff
path: root/internal/typeutils/internal.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2023-09-23 17:44:11 +0100
committerLibravatar GitHub <noreply@github.com>2023-09-23 18:44:11 +0200
commit8f67dd583d86155440e7905ae23083a9fea42f72 (patch)
treee67abf09a53c2d9053df8072b074a026969d93ef /internal/typeutils/internal.go
parent[chore] fix typo in slice.go (#2219) (diff)
downloadgotosocial-8f67dd583d86155440e7905ae23083a9fea42f72.tar.xz
[chore] deinterface the typeutils.Converter and update to use state structure (#2217)
* update typeconverter to use state structure * deinterface the typeutils.TypeConverter -> typeutils.Converter * finish copying over old type converter code comments * fix cherry-pick merge issues, fix tests pointing to old typeutils interface type still
Diffstat (limited to 'internal/typeutils/internal.go')
-rw-r--r--internal/typeutils/internal.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/typeutils/internal.go b/internal/typeutils/internal.go
index 831aad63e..1824a4421 100644
--- a/internal/typeutils/internal.go
+++ b/internal/typeutils/internal.go
@@ -26,7 +26,8 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/uris"
)
-func (c *converter) FollowRequestToFollow(ctx context.Context, f *gtsmodel.FollowRequest) *gtsmodel.Follow {
+// FollowRequestToFollow just converts a follow request into a follow, that's it! No bells and whistles.
+func (c *Converter) FollowRequestToFollow(ctx context.Context, f *gtsmodel.FollowRequest) *gtsmodel.Follow {
showReblogs := *f.ShowReblogs
notify := *f.Notify
return &gtsmodel.Follow{
@@ -41,7 +42,8 @@ func (c *converter) FollowRequestToFollow(ctx context.Context, f *gtsmodel.Follo
}
}
-func (c *converter) StatusToBoost(ctx context.Context, s *gtsmodel.Status, boostingAccount *gtsmodel.Account) (*gtsmodel.Status, error) {
+// StatusToBoost wraps the given status into a boosting status.
+func (c *Converter) StatusToBoost(ctx context.Context, s *gtsmodel.Status, boostingAccount *gtsmodel.Account) (*gtsmodel.Status, error) {
// the wrapper won't use the same ID as the boosted status so we generate some new UUIDs
accountURIs := uris.GenerateURIsForAccount(boostingAccount.Username)
boostWrapperStatusID := id.NewULID()