Fix status reference load remote statuses
This commit is contained in:
parent
d78281fb1d
commit
443e95d54b
2 changed files with 3 additions and 2 deletions
|
@ -87,7 +87,7 @@ class ProcessReferencesService < BaseService
|
||||||
|
|
||||||
target_urls.map do |url|
|
target_urls.map do |url|
|
||||||
status = ResolveURLService.new.call(url, on_behalf_of: @status.account, fetch_remote: @fetch_remote && @no_fetch_urls.exclude?(url))
|
status = ResolveURLService.new.call(url, on_behalf_of: @status.account, fetch_remote: @fetch_remote && @no_fetch_urls.exclude?(url))
|
||||||
@no_fetch_urls << url if !@fetch_remote && status.present?
|
@no_fetch_urls << url if !@fetch_remote && status.present? && status.local?
|
||||||
status
|
status
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -9,6 +9,7 @@ class ResolveURLService < BaseService
|
||||||
def call(url, on_behalf_of: nil, fetch_remote: true)
|
def call(url, on_behalf_of: nil, fetch_remote: true)
|
||||||
@url = url
|
@url = url
|
||||||
@on_behalf_of = on_behalf_of
|
@on_behalf_of = on_behalf_of
|
||||||
|
@fetch_remote = fetch_remote
|
||||||
|
|
||||||
if local_url?
|
if local_url?
|
||||||
process_local_url
|
process_local_url
|
||||||
|
@ -37,7 +38,7 @@ class ResolveURLService < BaseService
|
||||||
return account unless account.nil?
|
return account unless account.nil?
|
||||||
end
|
end
|
||||||
|
|
||||||
return unless @on_behalf_of.present? && [401, 403, 404].include?(fetch_resource_service.response_code)
|
return unless @on_behalf_of.present? && (!@fetch_remote || [401, 403, 404].include?(fetch_resource_service.response_code))
|
||||||
|
|
||||||
# It may happen that the resource is a private toot, and thus not fetchable,
|
# It may happen that the resource is a private toot, and thus not fetchable,
|
||||||
# but we can return the toot if we already know about it.
|
# but we can return the toot if we already know about it.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue