Procházet zdrojové kódy

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).
master
ThibG před 6 roky
committed by Eugen Rochko
rodič
revize
7bea1530f4
1 změnil soubory, kde provedl 4 přidání a 9 odebrání
  1. +4
    -9
      app/services/process_mentions_service.rb

+ 4
- 9
app/services/process_mentions_service.rb Zobrazit soubor

@@ -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?


Načítá se…
Zrušit
Uložit