0
0
Fork 0

Serialize ActivityPub alternate link into OStatus deletes, handle it (#4730)

Requires moving Atom rendering from DistributionWorker (where
`stream_entry.status` is already nil) to inline (where
`stream_entry.status.destroyed?` is true) and distributing that.

Unfortunately, such XML renderings can no longer be easily chained
together into one payload of n items.
This commit is contained in:
Eugen Rochko 2017-08-29 16:11:05 +02:00 committed by GitHub
parent 9958eba356
commit 4c76402ba1
7 changed files with 57 additions and 20 deletions

View file

@ -79,6 +79,9 @@ class OStatus::AtomSerializer
if stream_entry.status.nil?
append_element(entry, 'content', 'Deleted status')
elsif stream_entry.status.destroyed?
append_element(entry, 'content', 'Deleted status')
append_element(entry, 'link', nil, rel: :alternate, type: 'application/activity+json', href: ActivityPub::TagManager.instance.uri_for(stream_entry.status)) if stream_entry.account.local?
else
serialize_status_attributes(entry, stream_entry.status)
end