From 1ee675d68bfd2034183a03408a2377c338dfac41 Mon Sep 17 00:00:00 2001 From: ThibG Date: Fri, 17 Aug 2018 14:08:17 +0200 Subject: [PATCH] Use correct activity id in Accept when receiving duplicate Follow (fixes #8218) (#8244) --- app/lib/activitypub/activity/follow.rb | 2 +- app/services/authorize_follow_service.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/activitypub/activity/follow.rb b/app/lib/activitypub/activity/follow.rb index 826dcf18ef2..c458326482c 100644 --- a/app/lib/activitypub/activity/follow.rb +++ b/app/lib/activitypub/activity/follow.rb @@ -13,7 +13,7 @@ class ActivityPub::Activity::Follow < ActivityPub::Activity # Fast-forward repeat follow requests if @account.following?(target_account) - AuthorizeFollowService.new.call(@account, target_account, skip_follow_request: true) + AuthorizeFollowService.new.call(@account, target_account, skip_follow_request: true, follow_request_uri: @json['id']) return end diff --git a/app/services/authorize_follow_service.rb b/app/services/authorize_follow_service.rb index f47d488f11c..1674239df73 100644 --- a/app/services/authorize_follow_service.rb +++ b/app/services/authorize_follow_service.rb @@ -3,7 +3,7 @@ class AuthorizeFollowService < BaseService def call(source_account, target_account, **options) if options[:skip_follow_request] - follow_request = FollowRequest.new(account: source_account, target_account: target_account) + follow_request = FollowRequest.new(account: source_account, target_account: target_account, uri: options[:follow_request_uri]) else follow_request = FollowRequest.find_by!(account: source_account, target_account: target_account) follow_request.authorize!