Store Web Push subscriptions in DB

This commit is contained in:
Vyr Cossont 2024-11-30 12:24:13 -08:00
commit 0cffb8784e
25 changed files with 546 additions and 69 deletions

View file

@ -240,7 +240,7 @@ func (suite *FromFediAPITestSuite) TestProcessFave() {
notif := &gtsmodel.Notification{}
err = testStructs.State.DB.GetWhere(context.Background(), where, notif)
suite.NoError(err)
suite.Equal(gtsmodel.NotificationFave, notif.NotificationType)
suite.Equal(gtsmodel.NotificationFavourite, notif.NotificationType)
suite.Equal(fave.TargetAccountID, notif.TargetAccountID)
suite.Equal(fave.AccountID, notif.OriginAccountID)
suite.Equal(fave.StatusID, notif.StatusID)
@ -313,7 +313,7 @@ func (suite *FromFediAPITestSuite) TestProcessFaveWithDifferentReceivingAccount(
notif := &gtsmodel.Notification{}
err = testStructs.State.DB.GetWhere(context.Background(), where, notif)
suite.NoError(err)
suite.Equal(gtsmodel.NotificationFave, notif.NotificationType)
suite.Equal(gtsmodel.NotificationFavourite, notif.NotificationType)
suite.Equal(fave.TargetAccountID, notif.TargetAccountID)
suite.Equal(fave.AccountID, notif.OriginAccountID)
suite.Equal(fave.StatusID, notif.StatusID)

View file

@ -250,7 +250,7 @@ func (s *Surface) notifyFave(
// notify status author
// of fave by account.
if err := s.Notify(ctx,
gtsmodel.NotificationFave,
gtsmodel.NotificationFavourite,
fave.TargetAccount,
fave.Account,
fave.StatusID,
@ -521,7 +521,7 @@ func (s *Surface) notifySignup(ctx context.Context, newUser *gtsmodel.User) erro
var errs gtserror.MultiError
for _, mod := range modAccounts {
if err := s.Notify(ctx,
gtsmodel.NotificationSignup,
gtsmodel.NotificationAdminSignup,
mod,
newUser.Account,
"",