From 8f67dd583d86155440e7905ae23083a9fea42f72 Mon Sep 17 00:00:00 2001 From: kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com> Date: Sat, 23 Sep 2023 17:44:11 +0100 Subject: [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 --- internal/typeutils/internal.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'internal/typeutils/internal.go') 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 >smodel.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() -- cgit v1.2.3