Merge pull request #88 from safing/fix/notification-state

Fix/notification state
This commit is contained in:
Patrick Pacher 2020-10-08 14:07:56 +02:00 committed by GitHub
commit 5e55b66e6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -176,6 +176,11 @@ func (n *Notification) save(pushUpdate bool) *Notification {
n.Expires = time.Now().Add(72 * time.Hour).Unix()
}
// Make sure we always have a notification state assigned.
if n.State == "" {
n.State = Active
}
// check key
if n.DatabaseKey() == "" {
n.SetKey(fmt.Sprintf("notifications:all/%s", n.EventID))