about summary refs log tree commit diff
path: root/app/serializers/activitypub
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-05-30 16:47:17 +0200
committerThibG <thib@sitedethib.com>2020-05-30 18:27:00 +0200
commit9e04b9d8dfc57304e9c409e2bc20d838d673d432 (patch)
treeddde9cae3f5076611ddfbe12ce7e6d9f6455eb05 /app/serializers/activitypub
parent041c7691827357ceecb5c2d1ef47761b097be163 (diff)
Add support for setting Content Warning for CW-less outgoing toots
Diffstat (limited to 'app/serializers/activitypub')
-rw-r--r--app/serializers/activitypub/note_serializer.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb
index dce506fa2..96e94d797 100644
--- a/app/serializers/activitypub/note_serializer.rb
+++ b/app/serializers/activitypub/note_serializer.rb
@@ -35,7 +35,11 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer
   end
 
   def summary
-    object.spoiler_text.presence
+    object.spoiler_text.presence || Setting.outgoing_spoilers.presence
+  end
+
+  def sensitive
+    object.sensitive || Setting.outgoing_spoilers.present?
   end
 
   def content