From 58f78a7af2010d112111e40c01e2454ab82326af Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Tue, 21 May 2019 16:31:10 -0500 Subject: [PATCH] fix `thread:reall` --- app/lib/bangtags.rb | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/app/lib/bangtags.rb b/app/lib/bangtags.rb index 3441b7464..e6fcb62e4 100644 --- a/app/lib/bangtags.rb +++ b/app/lib/bangtags.rb @@ -226,10 +226,13 @@ class Bangtags case cmd[1].downcase when 'reall' if status.conversation_id.present? - mention_ids = Status.where(conversation_id: status.conversation_id).flat_map { |s| s.mentions.pluck(:account_id) } - mention_ids.uniq! - mentions = Account.where(id: mention_ids).map { |a| "@#{a.username}" } - chunk = mentions.join(' ') + participants = Status.where(conversation_id: status.conversation_id) + .pluck(:account_id).uniq.without(@account.id) + participants = Account.where(id: participants) + .pluck(:username, :domain) + .map { |a| "@#{a.compact.join('@')}" } + participants = (cmd[2..-1].map(&:strip) | participants) unless cmd[2].nil? + chunk = participants.join(' ') end when 'sharekey' next if cmd[2].nil?