From d2919f7e94a22971fb368f614ecccce2b055d231 Mon Sep 17 00:00:00 2001 From: puckipedia Date: Thu, 24 Oct 2019 20:45:43 +0000 Subject: Allow Accept/Reject with a non-embedded object (#12199) Some ActivityPub servers refuse to embed remote objects into their own output. This is because they are not the authoritative source for these objects, and as such embedding them is always a waste of space. The follow request and follow models contain a URI, so this can be used to match them. --- app/lib/activitypub/activity.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/lib/activitypub/activity.rb') diff --git a/app/lib/activitypub/activity.rb b/app/lib/activitypub/activity.rb index a4a9baaee..5cd48a6ae 100644 --- a/app/lib/activitypub/activity.rb +++ b/app/lib/activitypub/activity.rb @@ -153,6 +153,14 @@ class ActivityPub::Activity fetch_remote_original_status end + def follow_request_from_object + @follow_request ||= FollowRequest.find_by(target_account: @account, uri: object_uri) unless object_uri.nil? + end + + def follow_from_object + @follow ||= Follow.find_by(target_account: @account, uri: object_uri) unless object_uri.nil? + end + def fetch_remote_original_status if object_uri.start_with?('http') return if ActivityPub::TagManager.instance.local_uri?(object_uri) -- cgit