summaryrefslogtreecommitdiff
path: root/internal/processing/account/delete.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-02-22 16:05:26 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-22 16:05:26 +0100
commitb6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288 (patch)
treec79d1107375597ab8a79045c80dd62dc95a204e7 /internal/processing/account/delete.go
parent[bugfix] Remove initial storage cleanup (#1545) (diff)
downloadgotosocial-b6fbdc66c1ce1ec61ebfb6fcc0351ea627a1d288.tar.xz
[chore] Deinterface processor and subprocessors (#1501)
* [chore] Deinterface processor and subprocessors * expose subprocessors via function calls * missing license header
Diffstat (limited to 'internal/processing/account/delete.go')
-rw-r--r--internal/processing/account/delete.go29
1 files changed, 6 insertions, 23 deletions
diff --git a/internal/processing/account/delete.go b/internal/processing/account/delete.go
index 32321e196..7a31b45d4 100644
--- a/internal/processing/account/delete.go
+++ b/internal/processing/account/delete.go
@@ -34,28 +34,9 @@ import (
"golang.org/x/crypto/bcrypt"
)
-// Delete handles the complete deletion of an account.
-//
-// To be done in this function:
-// 1. Delete account's application(s), clients, and oauth tokens
-// 2. Delete account's blocks
-// 3. Delete account's emoji
-// 4. Delete account's follow requests
-// 5. Delete account's follows
-// 6. Delete account's statuses
-// 7. Delete account's media attachments
-// 8. Delete account's mentions
-// 9. Delete account's polls
-// 10. Delete account's notifications
-// 11. Delete account's bookmarks
-// 12. Delete account's faves
-// 13. Delete account's mutes
-// 14. Delete account's streams
-// 15. Delete account's tags
-// 16. Delete account's user
-// 17. Delete account's timeline
-// 18. Delete account itself
-func (p *processor) Delete(ctx context.Context, account *gtsmodel.Account, origin string) gtserror.WithCode {
+// Delete deletes an account, and all of that account's statuses, media, follows, notifications, etc etc etc.
+// The origin passed here should be either the ID of the account doing the delete (can be itself), or the ID of a domain block.
+func (p *Processor) Delete(ctx context.Context, account *gtsmodel.Account, origin string) gtserror.WithCode {
fields := kv.Fields{{"username", account.Username}}
if account.Domain != "" {
@@ -289,7 +270,9 @@ func (p *processor) Delete(ctx context.Context, account *gtsmodel.Account, origi
return nil
}
-func (p *processor) DeleteLocal(ctx context.Context, account *gtsmodel.Account, form *apimodel.AccountDeleteRequest) gtserror.WithCode {
+// DeleteLocal is like Delete, but specifically for deletion of local accounts rather than federated ones.
+// Unlike Delete, it will propagate the deletion out across the federating API to other instances.
+func (p *Processor) DeleteLocal(ctx context.Context, account *gtsmodel.Account, form *apimodel.AccountDeleteRequest) gtserror.WithCode {
fromClientAPIMessage := messages.FromClientAPI{
APObjectType: ap.ActorPerson,
APActivityType: ap.ActivityDelete,