about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorStarfall <root@starfall.blue>2020-04-11 20:04:46 -0500
committerStarfall <root@starfall.blue>2020-04-11 20:04:46 -0500
commit144ecfcfc7d9974117f1563084409a9558290a60 (patch)
treea26bd8374e4b8264dbae815fbfbd3b91ae51450b /app/models
parent12d35783db1bb302d7540d8d3690ab6eed3dac3b (diff)
Revert "Revert "Merge branch 'glitch'""
This reverts commit 12d35783db1bb302d7540d8d3690ab6eed3dac3b.
Diffstat (limited to 'app/models')
-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