mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-10 23:07:29 -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
10
internal/cache/invalidate.go
vendored
10
internal/cache/invalidate.go
vendored
|
|
@ -283,6 +283,11 @@ func (c *Caches) OnInvalidateStatusFave(fave *gtsmodel.StatusFave) {
|
|||
c.DB.StatusFaveIDs.Invalidate(fave.StatusID)
|
||||
}
|
||||
|
||||
func (c *Caches) OnInvalidateToken(token *gtsmodel.Token) {
|
||||
// Invalidate token's push subscription.
|
||||
c.DB.WebPushSubscription.Invalidate("ID", token.ID)
|
||||
}
|
||||
|
||||
func (c *Caches) OnInvalidateUser(user *gtsmodel.User) {
|
||||
// Invalidate local account ID cached visibility.
|
||||
c.Visibility.Invalidate("ItemID", user.AccountID)
|
||||
|
|
@ -296,3 +301,8 @@ func (c *Caches) OnInvalidateUserMute(mute *gtsmodel.UserMute) {
|
|||
// Invalidate source account's user mute lists.
|
||||
c.DB.UserMuteIDs.Invalidate(mute.AccountID)
|
||||
}
|
||||
|
||||
func (c *Caches) OnInvalidateWebPushSubscription(subscription *gtsmodel.WebPushSubscription) {
|
||||
// Invalidate source account's Web Push subscription list.
|
||||
c.DB.WebPushSubscriptionIDs.Invalidate(subscription.AccountID)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue