about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-05-21 16:31:10 -0500
committermultiple creatures <dev@multiple-creature.party>2019-05-21 16:31:10 -0500
commit58f78a7af2010d112111e40c01e2454ab82326af (patch)
tree416ee48dd11bf39b493161edd07ba4765c4544a3
parentd4ca04f24d8a566b759c2fd7c8869d60f46fa73e (diff)
fix `thread:reall`
-rw-r--r--app/lib/bangtags.rb11
1 files 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?