diff options
author | ThibG <thib@sitedethib.com> | 2021-01-12 09:25:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-12 09:25:01 +0100 |
commit | 7bed25f3eabecc84268a4b6c254cc3e0738926b6 (patch) | |
tree | ef193dba4073b7a4088e360455928549d621cffb /app/lib | |
parent | 11d603101a7b3389c679b8c155a3cb06203ca31a (diff) |
Fix processing of incoming Block activities (#15546)
Unlike locally-issued blocks, they weren't clearing follow relationships in both directions, follow requests or notifications. Co-authored-by: Claire <claire.github-309c@sitedethib.com>
Diffstat (limited to 'app/lib')
-rw-r--r-- | app/lib/activitypub/activity/block.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/block.rb b/app/lib/activitypub/activity/block.rb index 90477bf33..92a0f813f 100644 --- a/app/lib/activitypub/activity/block.rb +++ b/app/lib/activitypub/activity/block.rb @@ -11,8 +11,13 @@ class ActivityPub::Activity::Block < ActivityPub::Activity return end + UnfollowService.new.call(@account, target_account) if @account.following?(target_account) UnfollowService.new.call(target_account, @account) if target_account.following?(@account) + RejectFollowService.new.call(target_account, @account) if target_account.requested?(@account) - @account.block!(target_account, uri: @json['id']) unless delete_arrived_first?(@json['id']) + unless delete_arrived_first?(@json['id']) + BlockWorker.perform_async(@account.id, target_account.id) + @account.block!(target_account, uri: @json['id']) + end end end |