Browse Source

Use correct activity id in Accept when receiving duplicate Follow (fixes #8218) (#8244)

pull/4/head
ThibG 5 years ago
committed by Eugen Rochko
parent
commit
1ee675d68b
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      app/lib/activitypub/activity/follow.rb
  2. +1
    -1
      app/services/authorize_follow_service.rb

+ 1
- 1
app/lib/activitypub/activity/follow.rb View 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

+ 1
- 1
app/services/authorize_follow_service.rb View 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!

Loading…
Cancel
Save