diff options
author | 2021-09-03 10:27:40 +0100 | |
---|---|---|
committer | 2021-09-03 10:27:40 +0100 | |
commit | 25edd57eaf3eecf0b449a4dabb5b5fc5d6ae7687 (patch) | |
tree | b6cffb65d46a07f59d5393a257973910d4116227 /internal/processing/account/delete.go | |
parent | session name fix (#185) (diff) | |
parent | review changes (diff) | |
download | gotosocial-25edd57eaf3eecf0b449a4dabb5b5fc5d6ae7687.tar.xz |
Merge pull request #186 from superseriousbusiness/struct_validation
Struct validation
Diffstat (limited to 'internal/processing/account/delete.go')
-rw-r--r-- | internal/processing/account/delete.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/internal/processing/account/delete.go b/internal/processing/account/delete.go index d97af4d2e..5de706045 100644 --- a/internal/processing/account/delete.go +++ b/internal/processing/account/delete.go @@ -23,9 +23,10 @@ import ( "time" "github.com/sirupsen/logrus" + "github.com/superseriousbusiness/gotosocial/internal/ap" "github.com/superseriousbusiness/gotosocial/internal/db" "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" - "github.com/superseriousbusiness/gotosocial/internal/oauth" + "github.com/superseriousbusiness/gotosocial/internal/messages" ) // Delete handles the complete deletion of an account. @@ -64,12 +65,12 @@ func (p *processor) Delete(ctx context.Context, account *gtsmodel.Account, origi u := >smodel.User{} if err := p.db.GetWhere(ctx, []db.Where{{Key: "account_id", Value: account.ID}}, u); err == nil { // we got one! select all tokens with the user's ID - tokens := []*oauth.Token{} + tokens := []*gtsmodel.Token{} if err := p.db.GetWhere(ctx, []db.Where{{Key: "user_id", Value: u.ID}}, &tokens); err == nil { // we have some tokens to delete for _, t := range tokens { // delete client(s) associated with this token - if err := p.db.DeleteByID(ctx, t.ClientID, &oauth.Client{}); err != nil { + if err := p.db.DeleteByID(ctx, t.ClientID, >smodel.Client{}); err != nil { l.Errorf("error deleting oauth client: %s", err) } // delete application(s) associated with this token @@ -150,9 +151,9 @@ selectStatusesLoop: // pass the status delete through the client api channel for processing s.Account = account l.Debug("putting status in the client api channel") - p.fromClientAPI <- gtsmodel.FromClientAPI{ - APObjectType: gtsmodel.ActivityStreamsNote, - APActivityType: gtsmodel.ActivityStreamsDelete, + p.fromClientAPI <- messages.FromClientAPI{ + APObjectType: ap.ObjectNote, + APActivityType: ap.ActivityDelete, GTSModel: s, OriginAccount: account, TargetAccount: account, @@ -186,9 +187,9 @@ selectStatusesLoop: } l.Debug("putting boost undo in the client api channel") - p.fromClientAPI <- gtsmodel.FromClientAPI{ - APObjectType: gtsmodel.ActivityStreamsAnnounce, - APActivityType: gtsmodel.ActivityStreamsUndo, + p.fromClientAPI <- messages.FromClientAPI{ + APObjectType: ap.ActivityAnnounce, + APActivityType: ap.ActivityUndo, GTSModel: s, OriginAccount: b.Account, TargetAccount: account, |