about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-02-29 12:20:54 +0100
committerThibaut Girka <thib@sitedethib.com>2020-02-29 12:20:54 +0100
commit427ef4948a4fdd1c34e7c7baa6dd5c967e32d932 (patch)
tree6c00f4972e86f44ba1899385eb107838d146e5c1 /app
parente1d29f7d9f85a25af7a1595d2c9afc127ab36ca7 (diff)
parent5393b187c4601966f9be23490dfb1e54f3f3e725 (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Diffstat (limited to 'app')
-rw-r--r--app/models/account.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/models/account.rb b/app/models/account.rb
index e46888415..0fcf897c9 100644
--- a/app/models/account.rb
+++ b/app/models/account.rb
@@ -480,7 +480,16 @@ class Account < ApplicationRecord
     def from_text(text)
       return [] if text.blank?
 
-      text.scan(MENTION_RE).map { |match| match.first.split('@', 2) }.uniq.map { |(username, domain)| EntityCache.instance.mention(username, domain) }
+      text.scan(MENTION_RE).map { |match| match.first.split('@', 2) }.uniq.map do |(username, domain)|
+        domain = begin
+          if TagManager.instance.local_domain?(domain)
+            nil
+          else
+            TagManager.instance.normalize_domain(domain)
+          end
+        end
+        EntityCache.instance.mention(username, domain)
+      end.compact
     end
 
     private