]> cat aescling's git repositories - mastodon.git/commitdiff
Don't leave behind husk of remotely-deleted profile (#6159)
authorEugen Rochko <eugen@zeonfederated.com>
Tue, 2 Jan 2018 23:38:02 +0000 (00:38 +0100)
committerGitHub <noreply@github.com>
Tue, 2 Jan 2018 23:38:02 +0000 (00:38 +0100)
There's no reason for an Account record to persist after Delete->Actor is received. SuspendAccountService is necessary to make sure deleted toots get sent over streaming API properly and home feeds get cleaned up. By removing Account record, we can ensure that if in the future the account is restored remotely (or username reused), it can start with a clean slate.

app/lib/activitypub/activity/delete.rb

index d0fb4934254da72eeccc60134ddabbd33c0d183a..5fa60a81c6723e1b273cbfcbe6fb53b709453a5b 100644 (file)
@@ -13,6 +13,7 @@ class ActivityPub::Activity::Delete < ActivityPub::Activity
 
   def delete_person
     SuspendAccountService.new.call(@account)
+    @account.destroy!
   end
 
   def delete_note