From 24cec4e7aab33b6c44ba6d1ecf16895f254351b8 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Wed, 1 Mar 2023 18:52:44 +0100 Subject: [feature] Federate pinned posts (aka `featuredCollection`) in and out (#1560) * start fiddling * the ol' fiddle + update * start working on fetching statuses * poopy doopy doo where r u uwu * further adventures in featuring statuses * finishing up * fmt * simply status unpin loop * move empty featured check back to caller function * remove unnecessary log.WithContext calls * remove unnecessary IsIRI() checks * add explanatory comment about status URIs * change log level to error * better test names --- internal/api/activitypub/users/common.go | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'internal/api/activitypub/users/common.go') diff --git a/internal/api/activitypub/users/common.go b/internal/api/activitypub/users/common.go index f0e4891d5..93d9ba776 100644 --- a/internal/api/activitypub/users/common.go +++ b/internal/api/activitypub/users/common.go @@ -18,12 +18,14 @@ package users -// SwaggerCollection represents an activitypub collection. +// SwaggerCollection represents an ActivityPub Collection. // swagger:model swaggerCollection type SwaggerCollection struct { - // ActivityStreams context. + // ActivityStreams JSON-LD context. + // A string or an array of strings, or more + // complex nested items. // example: https://www.w3.org/ns/activitystreams - Context string `json:"@context"` + Context interface{} `json:"@context"` // ActivityStreams ID. // example: https://example.org/users/some_user/statuses/106717595988259568/replies ID string `json:"id"` @@ -55,3 +57,25 @@ type SwaggerCollectionPage struct { // example: ["https://example.org/users/some_other_user/statuses/086417595981111564", "https://another.example.com/users/another_user/statuses/01FCN8XDV3YG7B4R42QA6YQZ9R"] Items []string `json:"items"` } + +// SwaggerFeaturedCollection represents an ActivityPub OrderedCollection. +// swagger:model swaggerFeaturedCollection +type SwaggerFeaturedCollection struct { + // ActivityStreams JSON-LD context. + // A string or an array of strings, or more + // complex nested items. + // example: https://www.w3.org/ns/activitystreams + Context interface{} `json:"@context"` + // ActivityStreams ID. + // example: https://example.org/users/some_user/collections/featured + ID string `json:"id"` + // ActivityStreams type. + // example: OrderedCollection + Type string `json:"type"` + // List of status URIs. + // example: ['https://example.org/users/some_user/statuses/01GSZ0F7Q8SJKNRF777GJD271R', 'https://example.org/users/some_user/statuses/01GSZ0G012CBQ7TEKX689S3QRE'] + Items []string `json:"items"` + // Number of items in this collection. + // example: 2 + TotalItems int +} -- cgit v1.2.3