]> cat aescling's git repositories - mastodon.git/commitdiff
Use already-known remote user data if resolving temporarily fails in mentions (#5702)
authorThibG <thib@sitedethib.com>
Wed, 15 Nov 2017 00:06:49 +0000 (01:06 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 15 Nov 2017 00:06:49 +0000 (01:06 +0100)
app/services/process_mentions_service.rb

index c1ff6820903f319c3ec7ccfdccca61ff4b69447d..a229d4ff861beb3044e394a94193b8fb7458865f 100644 (file)
@@ -17,6 +17,11 @@ class ProcessMentionsService < BaseService
         mentioned_account = nil
       end
 
+      if mentioned_account.nil?
+        username, domain  = match.first.split('@')
+        mentioned_account = Account.find_remote(username, domain)
+      end
+
       next match if mentioned_account.nil? || (!mentioned_account.local? && mentioned_account.ostatus? && status.stream_entry.hidden?)
 
       mentioned_account.mentions.where(status: status).first_or_create(status: status)