From 2796a2e82f16ade9872008878cf88299bd66b4e7 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 31 Jul 2023 15:47:35 +0200 Subject: [feature] Hashtag federation (in/out), hashtag client API endpoints (#2032) * update go-fed * do the things * remove unused columns from tags * update to latest lingo from main * further tag shenanigans * serve stub page at tag endpoint * we did it lads * tests, oh tests, ohhh tests, oh tests (doo doo doo doo) * swagger docs * document hashtag usage + federation * instanceGet * don't bother parsing tag href * rename whereStartsWith -> whereStartsLike * remove GetOrCreateTag * dont cache status tag timelineability --- internal/typeutils/converter.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'internal/typeutils/converter.go') diff --git a/internal/typeutils/converter.go b/internal/typeutils/converter.go index 9121564fb..cb69cba5d 100644 --- a/internal/typeutils/converter.go +++ b/internal/typeutils/converter.go @@ -71,7 +71,8 @@ type TypeConverter interface { // EmojiCategoryToAPIEmojiCategory converts a gts model emoji category into its api (frontend) representation. EmojiCategoryToAPIEmojiCategory(ctx context.Context, category *gtsmodel.EmojiCategory) (*apimodel.EmojiCategory, error) // TagToAPITag converts a gts model tag into its api (frontend) representation for serialization on the API. - TagToAPITag(ctx context.Context, t *gtsmodel.Tag) (apimodel.Tag, error) + // If stubHistory is set to 'true', then the 'history' field of the tag will be populated with a pointer to an empty slice, for API compatibility reasons. + TagToAPITag(ctx context.Context, t *gtsmodel.Tag, stubHistory bool) (apimodel.Tag, error) // StatusToAPIStatus converts a gts model status into its api (frontend) representation for serialization on the API. // // Requesting account can be nil. @@ -160,6 +161,8 @@ type TypeConverter interface { MentionToAS(ctx context.Context, m *gtsmodel.Mention) (vocab.ActivityStreamsMention, error) // EmojiToAS converts a gts emoji into a mastodon ns Emoji, suitable for federation EmojiToAS(ctx context.Context, e *gtsmodel.Emoji) (vocab.TootEmoji, error) + // TagToAS converts a gts model tag into a toot Hashtag, suitable for federation. + TagToAS(ctx context.Context, t *gtsmodel.Tag) (vocab.TootHashtag, error) // AttachmentToAS converts a gts model media attachment into an activity streams Attachment, suitable for federation AttachmentToAS(ctx context.Context, a *gtsmodel.MediaAttachment) (vocab.ActivityStreamsDocument, error) // FaveToAS converts a gts model status fave into an activityStreams LIKE, suitable for federation. -- cgit v1.2.3