mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[feature] Implement Web Push notification policy (#3721)
* Web Push: add policy column to subscriptions * Web Push: add policy to API * Web Push: test notification policy * go-fmt unrelated file (how did this get thru?)
This commit is contained in:
@ -24,6 +24,7 @@ import (
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/id"
|
||||
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
|
||||
)
|
||||
|
||||
// CreateOrReplace creates a Web Push subscription for the given access token,
|
||||
@ -54,6 +55,7 @@ func (p *Processor) CreateOrReplace(
|
||||
Auth: request.Subscription.Keys.Auth,
|
||||
P256dh: request.Subscription.Keys.P256dh,
|
||||
NotificationFlags: alertsToNotificationFlags(request.Data.Alerts),
|
||||
Policy: typeutils.APIWebPushNotificationPolicyToWebPushNotificationPolicy(*request.Data.Policy),
|
||||
}
|
||||
|
||||
if err := p.state.DB.PutWebPushSubscription(ctx, subscription); err != nil {
|
||||
|
Reference in New Issue
Block a user