]> cat aescling's git repositories - mastodon.git/commitdiff
Use correct activity id in Accept when receiving duplicate Follow (fixes #8218) ...
authorThibG <thib@sitedethib.com>
Fri, 17 Aug 2018 12:08:17 +0000 (14:08 +0200)
committerEugen Rochko <eugen@zeonfederated.com>
Fri, 17 Aug 2018 12:08:17 +0000 (14:08 +0200)
app/lib/activitypub/activity/follow.rb
app/services/authorize_follow_service.rb

index 826dcf18ef27d76f3ff71304f04fff4c3db17259..c458326482c511cb7b47e72699ea79204f8ba731 100644 (file)
@@ -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
 
index f47d488f11c6db297aab466b2f5fe388ace95425..1674239df7382f5b1ea8a0b74c9c796db47f7603 100644 (file)
@@ -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!