]> cat aescling's git repositories - mastodon.git/commitdiff
Raise exception when attempting to serialize local-only statuses
authorThibaut Girka <thib@sitedethib.com>
Wed, 29 May 2019 20:32:24 +0000 (22:32 +0200)
committerThibG <thib@sitedethib.com>
Thu, 30 May 2019 07:04:12 +0000 (09:04 +0200)
app/serializers/activitypub/note_serializer.rb

index 67f596e78a65042a85821ae7693047dbfefc9e4e..7225b23192c5044358f8486c835798c9d31fd77f 100644 (file)
@@ -25,6 +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?
     ActivityPub::TagManager.instance.uri_for(object)
   end