From 6992413720c67aa8d0b0b8218a4de8276fd4dc51 Mon Sep 17 00:00:00 2001 From: kyori19 Date: Tue, 10 May 2022 09:48:44 +0000 Subject: [PATCH] Fix outgoing note contains nyaized text --- app/helpers/formatting_helper.rb | 4 ++-- app/serializers/activitypub/note_serializer.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/formatting_helper.rb b/app/helpers/formatting_helper.rb index 64eecb856..b1543fac0 100644 --- a/app/helpers/formatting_helper.rb +++ b/app/helpers/formatting_helper.rb @@ -14,12 +14,12 @@ module FormattingHelper end module_function :extract_status_plain_text - def status_content_format(status) + def status_content_format(status, outgoing: false) html_aware_format( status.text, status.local?, preloaded_accounts: [status.account] + (status.respond_to?(:active_mentions) ? status.active_mentions.map(&:account) : []), - nyaize: status.account.cat + nyaize: !outgoing && status.account.cat, ) end diff --git a/app/serializers/activitypub/note_serializer.rb b/app/serializers/activitypub/note_serializer.rb index 27e058199..d8671149e 100644 --- a/app/serializers/activitypub/note_serializer.rb +++ b/app/serializers/activitypub/note_serializer.rb @@ -41,7 +41,7 @@ class ActivityPub::NoteSerializer < ActivityPub::Serializer end def content - status_content_format(object) + status_content_format(object, outgoing: true) end def content_map