diff options
author | ThibG <thib@sitedethib.com> | 2017-11-07 14:31:57 +0100 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-11-07 14:31:57 +0100 |
commit | 7bea1530f4b396ae384502b3fcbf8d34f22005e1 (patch) | |
tree | 5f34caee92775264baf1ddff509d7a420726d969 | |
parent | 47b0c6185356d4a2533b3ef96e9775a3a82da079 (diff) |
Resolve remote accounts when mentioned even if they are already known (#5539)
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).
-rw-r--r-- | app/services/process_mentions_service.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/app/services/process_mentions_service.rb b/app/services/process_mentions_service.rb index 1fd2ece1c..17c01a91d 100644 --- a/app/services/process_mentions_service.rb +++ b/app/services/process_mentions_service.rb @@ -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? |