diff options
author | Till <2353100+S7evinK@users.noreply.github.com> | 2022-08-30 14:54:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-30 14:54:57 +0200 |
commit | 93a6e2f4d30d72c015c7086b97322f0b106ab061 (patch) | |
tree | 678ddec60e488000d1955c8716cabf002fd7d8b7 /userapi | |
parent | 7313f56f44f6820a5573aad79faaa6037703371f (diff) |
Set the notification count when sending push notifications (#2683)
Diffstat (limited to 'userapi')
-rw-r--r-- | userapi/consumers/syncapi_streamevent.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/userapi/consumers/syncapi_streamevent.go b/userapi/consumers/syncapi_streamevent.go index 7807c763..ec351ef7 100644 --- a/userapi/consumers/syncapi_streamevent.go +++ b/userapi/consumers/syncapi_streamevent.go @@ -7,6 +7,10 @@ import ( "strings" "time" + "github.com/matrix-org/gomatrixserverlib" + "github.com/nats-io/nats.go" + log "github.com/sirupsen/logrus" + "github.com/matrix-org/dendrite/internal/eventutil" "github.com/matrix-org/dendrite/internal/pushgateway" "github.com/matrix-org/dendrite/internal/pushrules" @@ -20,9 +24,6 @@ import ( "github.com/matrix-org/dendrite/userapi/storage" "github.com/matrix-org/dendrite/userapi/storage/tables" "github.com/matrix-org/dendrite/userapi/util" - "github.com/matrix-org/gomatrixserverlib" - "github.com/nats-io/nats.go" - log "github.com/sirupsen/logrus" ) type OutputStreamEventConsumer struct { @@ -529,7 +530,9 @@ func (s *OutputStreamEventConsumer) notifyHTTP(ctx context.Context, event *gomat case "event_id_only": req = pushgateway.NotifyRequest{ Notification: pushgateway.Notification{ - Counts: &pushgateway.Counts{}, + Counts: &pushgateway.Counts{ + Unread: userNumUnreadNotifs, + }, Devices: devices, EventID: event.EventID(), RoomID: event.RoomID(), |