ckolderup / postmarks

a single-user bookmarking website designed to live on the Fediverse
https://postmarks.glitch.me
MIT License
464 stars 38 forks source link

Updated AP outbox generation. Closes #41. #112

Closed steve-bate closed 1 year ago

steve-bate commented 1 year ago

Creates synthetic Create activities, with stable URIs, to wrap note messages from the activitypub database. These synthetic activity URIs can also be dereferenced (in addition to directly dereferencing Notes/messages).

The synthetic activities are given a URI that's based on the Note/message URIs. During dereferencing, the route handler can determine if an Activity or Note is being requested and wrap the Note if the Activity was requested.

I changed the structure of the collection objects. I'm guessing that the previous structure may have been inspired by Example 20 of the AS2 specification. This is a confusing and misleading example for AP purposes. The new structure matches Figure 21 of the AS2 specification. There is an OrderedCollection with links to a series of OrderedCollectionPages with first, last, next, prev links. So, a query without a page specified will return the OrderedCollection and the page queries will return an OrderedCollectionPage. This is consistent with how Mastodon handles outbox queries.