mirror of
https://git.bsd.gay/fef/nyastodon.git
synced 2024-12-29 07:53:41 +01:00
Check for instance availability before attempting to fetch mentioned users
Port ofdb6b0a3b5d
andd59d1d472e
. Full credit goes to dwrss on GitHub. Does NOT fix https://github.com/mastodon/mastodon/issues/22713.
This commit is contained in:
parent
004b2fc290
commit
560c06463d
1 changed files with 7 additions and 2 deletions
|
@ -222,8 +222,13 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
|
|||
return if tag['href'].blank?
|
||||
|
||||
account = account_from_uri(tag['href'])
|
||||
account = ActivityPub::FetchRemoteAccountService.new.call(tag['href'], request_id: @options[:request_id]) if account.nil?
|
||||
|
||||
begin
|
||||
return unless account || DeliveryFailureTracker.available?(tag['href'])
|
||||
account = ActivityPub::FetchRemoteAccountService.new.call(tag['href'], request_id: @options[:request_id]) if account.nil?
|
||||
rescue HTTP::ConnectionError => e
|
||||
Rails.logger.info "Fetching account #{tag['href']} failed: #{e}"
|
||||
raise
|
||||
end
|
||||
return if account.nil?
|
||||
|
||||
@mentions << Mention.new(account: account, silent: false)
|
||||
|
|
Loading…
Reference in a new issue