about summary refs log tree commit diff
path: root/app/services/resolve_mentions_service.rb
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-08-02 07:29:17 -0500
committerFire Demon <firedemon@creature.cafe>2020-08-30 05:45:17 -0500
commita834d8f61f4becb40ed1b764d598263c64682fee (patch)
treed88a2dd144c8381502cb78798ad7edc0c6efa8c8 /app/services/resolve_mentions_service.rb
parent8fea4f74ed1e98db835f35be3cbb3735233e0346 (diff)
[Federation] Do not force-reveal passive mentions of secondary audience - these are participants allowed to access a limited-audience thread, not Mastodon mentions
Diffstat (limited to 'app/services/resolve_mentions_service.rb')
-rw-r--r--app/services/resolve_mentions_service.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/services/resolve_mentions_service.rb b/app/services/resolve_mentions_service.rb
index 06238c44e..176caa8fe 100644
--- a/app/services/resolve_mentions_service.rb
+++ b/app/services/resolve_mentions_service.rb
@@ -8,9 +8,10 @@ class ResolveMentionsService < BaseService
   # @option [Boolean] :reveal_implicit_mentions Append implicit mentions to text
   # @return [Array] Array containing text with mentions resolved (String) and mention pointers (Set)
   def call(status, text: nil, mentions: [], reveal_implicit_mentions: true)
-    mentions                  = Mention.includes(:account).where(id: mentions.pluck(:id), accounts: { suspended_at: nil }).to_set
-    implicit_mention_acct_ids = mentions.pluck(:account_id).to_set
+    mentions                  = Mention.includes(:account).where(id: mentions.pluck(:id), accounts: { suspended_at: nil })
+    implicit_mention_acct_ids = mentions.active.pluck(:account_id).to_set
     text                      = status.text if text.nil?
+    mentions                  = mentions.to_set
 
     text.gsub(Account::MENTION_RE) do |match|
       username, domain = Regexp.last_match(1).split('@')