mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-11 15:19:02 +02:00
Implement push subscription expiry
This commit is contained in:
parent
47ad024ec7
commit
0f0074cbab
16 changed files with 272 additions and 102 deletions
server
|
@ -468,10 +468,29 @@ type apiStripeSubscriptionDeletedEvent struct {
|
|||
}
|
||||
|
||||
type webPushPayload struct {
|
||||
Event string `json:"event"`
|
||||
SubscriptionID string `json:"subscription_id"`
|
||||
Message message `json:"message"`
|
||||
}
|
||||
|
||||
func newWebPushPayload(subscriptionID string, message message) webPushPayload {
|
||||
return webPushPayload{
|
||||
Event: "message",
|
||||
SubscriptionID: subscriptionID,
|
||||
Message: message,
|
||||
}
|
||||
}
|
||||
|
||||
type webPushControlMessagePayload struct {
|
||||
Event string `json:"event"`
|
||||
}
|
||||
|
||||
func newWebPushSubscriptionExpiringPayload() webPushControlMessagePayload {
|
||||
return webPushControlMessagePayload{
|
||||
Event: "subscription_expiring",
|
||||
}
|
||||
}
|
||||
|
||||
type webPushSubscription struct {
|
||||
BrowserSubscription webpush.Subscription
|
||||
UserID string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue