diff options
author | Thibaut Girka <thib@sitedethib.com> | 2019-07-05 21:34:03 +0200 |
---|---|---|
committer | ThibG <thib@sitedethib.com> | 2019-07-05 21:50:19 +0200 |
commit | e5f4d83e60305e2f502f18f507ad79d8fbccfe77 (patch) | |
tree | e607d26ecfcd336e3e5f440cc8ab594d07d40725 | |
parent | c94966891af1ff456c6382595c07c2d68c57ec49 (diff) |
Allow serializing local-only toots in backup service
Fixes #1153
-rw-r--r-- | app/serializers/activitypub/note_serializer.rb | 2 | ||||
-rw-r--r-- | app/services/backup_service.rb | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index 7225b2319..61fa77852 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.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 diff --git a/app/services/backup_service.rb b/app/services/backup_service.rb index 5fcc98057..bd9e77223 100644 --- a/app/services/backup_service.rb +++ b/app/services/backup_service.rb @@ -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 |