From 974b3805b7d6dd27730846847e19bc4204f16dc6 Mon Sep 17 00:00:00 2001 From: Fire Demon Date: Wed, 21 Oct 2020 02:36:40 -0500 Subject: When a local user blocks a server, ask the server to remove their data --- app/javascript/mastodon/locales/en-MP.json | 1 + app/services/after_block_domain_from_account_service.rb | 5 +++++ 2 files changed, 6 insertions(+) (limited to 'app') diff --git a/app/javascript/mastodon/locales/en-MP.json b/app/javascript/mastodon/locales/en-MP.json index 88a0087b6..fcd8ee053 100644 --- a/app/javascript/mastodon/locales/en-MP.json +++ b/app/javascript/mastodon/locales/en-MP.json @@ -39,6 +39,7 @@ "confirmations.publish.confirm": "Publish", "confirmations.publish.message": "Are you ready to publish your roar?", "confirmations.redraft.message": "Are you sure you want to delete and redraft this roar? Admirations and boosts will be lost, and replies to the original roar will be orphaned.", + "confirmations.domain_block.message": "You are about to block and defederate from the {domain} server. If you proceed, Monsterpit will ask this server to permanently delete any data associated with your account.", "content-type.change": "Content type", "directory.federated": "From Fediverse", "directory.local": "From Monsterpit", diff --git a/app/services/after_block_domain_from_account_service.rb b/app/services/after_block_domain_from_account_service.rb index 89d007c1c..30f925bda 100644 --- a/app/services/after_block_domain_from_account_service.rb +++ b/app/services/after_block_domain_from_account_service.rb @@ -11,6 +11,7 @@ class AfterBlockDomainFromAccountService < BaseService @domain = domain clear_notifications! + defederate_from_domain! remove_follows! reject_existing_followers! reject_pending_follow_requests! @@ -18,6 +19,10 @@ class AfterBlockDomainFromAccountService < BaseService private + def defederate_from_domain! + DefederateAccountService.new.call(@account, domain) + end + def remove_follows! @account.active_relationships.where(target_account: Account.where(domain: @domain)).includes(:target_account).reorder(nil).find_each do |follow| UnfollowService.new.call(@account, follow.target_account) -- cgit