diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-10-21 02:36:40 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-10-21 02:36:40 -0500 |
commit | 974b3805b7d6dd27730846847e19bc4204f16dc6 (patch) | |
tree | 726d1090c5a51d4efcdf7c2e8ecbf89fdd977bf1 | |
parent | 0a32c484e1b8819983514f6f06da30c910cdd133 (diff) |
When a local user blocks a server, ask the server to remove their data
-rw-r--r-- | app/javascript/mastodon/locales/en-MP.json | 1 | ||||
-rw-r--r-- | app/services/after_block_domain_from_account_service.rb | 5 |
2 files changed, 6 insertions, 0 deletions
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) |