mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-13 03:17:30 -06:00
Store Web Push subscriptions in DB
This commit is contained in:
parent
db2ba34630
commit
0cffb8784e
25 changed files with 546 additions and 69 deletions
|
|
@ -19,6 +19,7 @@ package testrig
|
|||
|
||||
import (
|
||||
"context"
|
||||
|
||||
webpushgo "github.com/SherClockHolmes/webpush-go"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/db/bundb"
|
||||
|
|
@ -61,6 +62,8 @@ var testModels = []interface{}{
|
|||
>smodel.ThreadToStatus{},
|
||||
>smodel.User{},
|
||||
>smodel.UserMute{},
|
||||
>smodel.VAPIDKeyPair{},
|
||||
>smodel.WebPushSubscription{},
|
||||
>smodel.Emoji{},
|
||||
>smodel.Instance{},
|
||||
>smodel.Notification{},
|
||||
|
|
@ -348,6 +351,12 @@ func StandardDBSetup(db db.DB, accounts map[string]*gtsmodel.Account) {
|
|||
}
|
||||
}
|
||||
|
||||
for _, v := range NewTestWebPushSubscriptions() {
|
||||
if err := db.Put(ctx, v); err != nil {
|
||||
log.Panic(nil, err)
|
||||
}
|
||||
}
|
||||
|
||||
for _, v := range NewTestInteractionRequests() {
|
||||
if err := db.Put(ctx, v); err != nil {
|
||||
log.Panic(ctx, err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue