Allow serializing local-only toots in backup service

Fixes #1153
master
Thibaut Girka 5 years ago committed by ThibG
parent c94966891a
commit e5f4d83e60
  1. 2
      app/serializers/activitypub/note_serializer.rb
  2. 3
      app/services/backup_service.rb

@ -25,7 +25,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
attribute :closed, if: :poll_and_expired?
def id
raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only?
raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only? && !instance_options[:allow_local_only]
ActivityPub::TagManager.instance.uri_for(object)
end

@ -149,7 +149,8 @@ class BackupService < BaseService
ActiveModelSerializers::SerializableResource.new(
object,
serializer: serializer,
adapter: ActivityPub::Adapter
adapter: ActivityPub::Adapter,
allow_local_only: true,
).as_json
end

Loading…
Cancel
Save