From b644f1c5050c96fd95b573cac1f406e6d85446c9 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Sat, 3 Aug 2019 13:47:20 -0500 Subject: respect 'don't @ me' requests --- app/serializers/activitypub/note_serializer.rb | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'app/serializers/activitypub') diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index 56975ed80..ff39c97c4 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -2,12 +2,14 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer context_extensions :conversation, :sensitive, :big, - :hashtag, :emoji, :focal_point, :blurhash + :hashtag, :emoji, :focal_point, :blurhash, + :reject_replies attributes :id, :type, :summary, :in_reply_to, :published, :url, :attributed_to, :to, :cc, :sensitive, - :conversation, :source, :tails_never_fail + :conversation, :source, :tails_never_fail, + :reject_replies attribute :content attribute :content_map, if: :language? @@ -143,6 +145,10 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer object.preloadable_poll&.expired? end + def reject_replies + object.reject_replies == true + end + def tails_never_fail true end -- cgit