mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-25 13:11:37 +00:00
Set the notification count when sending push notifications (#2683)
This commit is contained in:
parent
7313f56f44
commit
93a6e2f4d3
@ -7,6 +7,10 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
"time"
|
"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/eventutil"
|
||||||
"github.com/matrix-org/dendrite/internal/pushgateway"
|
"github.com/matrix-org/dendrite/internal/pushgateway"
|
||||||
"github.com/matrix-org/dendrite/internal/pushrules"
|
"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"
|
||||||
"github.com/matrix-org/dendrite/userapi/storage/tables"
|
"github.com/matrix-org/dendrite/userapi/storage/tables"
|
||||||
"github.com/matrix-org/dendrite/userapi/util"
|
"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 {
|
type OutputStreamEventConsumer struct {
|
||||||
@ -529,7 +530,9 @@ func (s *OutputStreamEventConsumer) notifyHTTP(ctx context.Context, event *gomat
|
|||||||
case "event_id_only":
|
case "event_id_only":
|
||||||
req = pushgateway.NotifyRequest{
|
req = pushgateway.NotifyRequest{
|
||||||
Notification: pushgateway.Notification{
|
Notification: pushgateway.Notification{
|
||||||
Counts: &pushgateway.Counts{},
|
Counts: &pushgateway.Counts{
|
||||||
|
Unread: userNumUnreadNotifs,
|
||||||
|
},
|
||||||
Devices: devices,
|
Devices: devices,
|
||||||
EventID: event.EventID(),
|
EventID: event.EventID(),
|
||||||
RoomID: event.RoomID(),
|
RoomID: event.RoomID(),
|
||||||
|
Loading…
Reference in New Issue
Block a user