]> cat aescling's git repositories - mastodon.git/commitdiff
Fix backup archive including outgoing-only content warnings
authorThibaut Girka <thib@sitedethib.com>
Sat, 30 May 2020 14:56:23 +0000 (16:56 +0200)
committerThibG <thib@sitedethib.com>
Sat, 30 May 2020 16:27:00 +0000 (18:27 +0200)
app/serializers/activitypub/note_serializer.rb

index 96e94d7972b8c6dd3142cf7d3e67454c5809f6d2..e2d2b6bec3f99fdb64c706225959abaae1bcb5ac 100644 (file)
@@ -35,11 +35,11 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
   end
 
   def summary
-    object.spoiler_text.presence || Setting.outgoing_spoilers.presence
+    object.spoiler_text.presence || (instance_options[:allow_local_only] ? nil : Setting.outgoing_spoilers.presence)
   end
 
   def sensitive
-    object.sensitive || Setting.outgoing_spoilers.present?
+    object.sensitive || (!instance_options[:allow_local_only] && Setting.outgoing_spoilers.present?)
   end
 
   def content