summaryrefslogtreecommitdiff
path: root/internal/api/activitypub/users/common.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-03-01 18:52:44 +0100
committerLibravatar GitHub <noreply@github.com>2023-03-01 17:52:44 +0000
commit24cec4e7aab33b6c44ba6d1ecf16895f254351b8 (patch)
treecf0107a34e0fa00ab1b68aed4b52afe502147393 /internal/api/activitypub/users/common.go
parent[chore/performance] simplify storage driver to use storage.Storage directly (... (diff)
downloadgotosocial-24cec4e7aab33b6c44ba6d1ecf16895f254351b8.tar.xz
[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
Diffstat (limited to 'internal/api/activitypub/users/common.go')
-rw-r--r--internal/api/activitypub/users/common.go30
1 files changed, 27 insertions, 3 deletions
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
+}