about summary refs log tree commit diff
path: root/app/serializers/activitypub/note_serializer.rb
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2019-07-05 21:34:03 +0200
committermultiple creatures <dev@multiple-creature.party>2020-04-04 12:19:18 -0500
commit3ef5f13ee6baffbec68593c4ddc4f99bfec65201 (patch)
tree747747a195fe6bd101450297af2980e7df253380 /app/serializers/activitypub/note_serializer.rb
parentf54dc524d1b0f42db9439ead8158dc8a2f17071d (diff)
port glitch-soc@e5f4d83 to monsterfork: Allow serializing local-only toots in backup service
Fixes #1153
Diffstat (limited to 'app/serializers/activitypub/note_serializer.rb')
-rw-r--r--app/serializers/activitypub/note_serializer.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb
index 3492069cc..878b4bf13 100644
--- a/app/serializers/activitypub/note_serializer.rb
+++ b/app/serializers/activitypub/note_serializer.rb
@@ -34,8 +34,8 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
   end
 
   def id
-    raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only?
-    raise Mastodon::NotPermittedError, 'Hidden statuses should not be serialized' if object.hidden
+    raise Mastodon::NotPermittedError, 'Local-only statuses should not be serialized' if object.local_only && !instance_options[:allow_local_only]
+    raise Mastodon::NotPermittedError, 'Hidden statuses should not be serialized' if object.hidden && !instance_options[:allow_local_only]
 
     ActivityPub::TagManager.instance.uri_for(object)
   end