Skip to content
Snippets Groups Projects
Commit d37a56c0 authored by ThibG's avatar ThibG Committed by unarist
Browse files

Update remote ActivityPub users when fetching their toots (#5545)

parent 2cea4592
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ class ActivityPub::FetchRemoteStatusService < BaseService
return if actor_id.nil? || !trustworthy_attribution?(@json['id'], actor_id)
actor = ActivityPub::TagManager.instance.uri_to_resource(actor_id, Account)
actor = ActivityPub::FetchRemoteAccountService.new.call(actor_id, id: true) if actor.nil?
actor = ActivityPub::FetchRemoteAccountService.new.call(actor_id, id: true) if actor.nil? || needs_update(actor)
return if actor.suspended?
......@@ -44,4 +44,8 @@ class ActivityPub::FetchRemoteStatusService < BaseService
def expected_type?
%w(Note Article).include? @json['type']
end
def needs_update(actor)
actor.possibly_stale?
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment