]> cat aescling's git repositories - mastodon.git/commitdiff
Resolve remote accounts when mentioned even if they are already known (#5539)
authorThibG <thib@sitedethib.com>
Tue, 7 Nov 2017 13:31:57 +0000 (14:31 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Tue, 7 Nov 2017 13:31:57 +0000 (14:31 +0100)
This commit reduces the risk of not having up-to-date public key or protocol
information for a remote account, which is required to deliver toots
(especially direct messages).

app/services/process_mentions_service.rb

index 1fd2ece1c7a1b1f64a7604e7e468a0a94c9792a6..17c01a91dee0f7614f5a8f09c7782fae85f3827e 100644 (file)
@@ -11,15 +11,10 @@ class ProcessMentionsService < BaseService
     return unless status.local?
 
     status.text.scan(Account::MENTION_RE).each do |match|
-      username, domain  = match.first.split('@')
-      mentioned_account = Account.find_remote(username, domain)
-
-      if mentioned_account.nil? && !domain.nil?
-        begin
-          mentioned_account = resolve_remote_account_service.call(match.first.to_s)
-        rescue Goldfinger::Error, HTTP::Error
-          mentioned_account = nil
-        end
+      begin
+        mentioned_account = resolve_remote_account_service.call(match.first.to_s)
+      rescue Goldfinger::Error, HTTP::Error
+        mentioned_account = nil
       end
 
       next if mentioned_account.nil?