mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-02-10 10:06:33 +01:00
Delete Web Push subscriptions when account is deleted
This commit is contained in:
parent
8e72a8fd24
commit
1fe29c7c43
1 changed files with 5 additions and 1 deletions
|
@ -96,7 +96,7 @@ func (p *Processor) Delete(
|
||||||
}
|
}
|
||||||
|
|
||||||
// deleteUserAndTokensForAccount deletes the gtsmodel.User and
|
// deleteUserAndTokensForAccount deletes the gtsmodel.User and
|
||||||
// any OAuth tokens and applications for the given account.
|
// any OAuth tokens, applications, and Web Push subscriptions for the given account.
|
||||||
//
|
//
|
||||||
// Callers to this function should already have checked that
|
// Callers to this function should already have checked that
|
||||||
// this is a local account, or else it won't have a user associated
|
// this is a local account, or else it won't have a user associated
|
||||||
|
@ -129,6 +129,10 @@ func (p *Processor) deleteUserAndTokensForAccount(ctx context.Context, account *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := p.state.DB.DeleteWebPushSubscriptionsByAccountID(ctx, account.ID); err != nil {
|
||||||
|
return gtserror.Newf("db error deleting Web Push subscriptions: %w", err)
|
||||||
|
}
|
||||||
|
|
||||||
columns, err := stubbifyUser(user)
|
columns, err := stubbifyUser(user)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return gtserror.Newf("error stubbifying user: %w", err)
|
return gtserror.Newf("error stubbifying user: %w", err)
|
||||||
|
|
Loading…
Reference in a new issue