1
0
Fork 0
forked from gitea/nas

Fix duplicate orderedItems in user archive's outbox.json (#31099)

This commit is contained in:
KMY 2024-08-16 22:24:12 +09:00
parent ad7d1fff25
commit 0b06fb17d8
4 changed files with 10 additions and 9 deletions

View file

@ -19,8 +19,8 @@ class BackupService < BaseService
def build_outbox_json!(file)
skeleton = serialize(collection_presenter, ActivityPub::CollectionSerializer)
skeleton['@context'] = full_context
skeleton['orderedItems'] = ['!PLACEHOLDER!']
skeleton[:@context] = full_context
skeleton[:orderedItems] = ['!PLACEHOLDER!']
skeleton = Oj.dump(skeleton)
prepend, append = skeleton.split('"!PLACEHOLDER!"')
add_comma = false
@ -33,7 +33,7 @@ class BackupService < BaseService
file.write(statuses.map do |status|
item = serialize_payload(ActivityPub::ActivityPresenter.from_status(status, use_bearcap: false), ActivityPub::ActivitySerializer)
item.delete('@context')
item.delete(:@context)
unless item[:type] == 'Announce' || item[:object][:attachment].blank?
item[:object][:attachment].each do |attachment|