mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-03-03 17:03:10 -06:00
Use a pointer to UnreadNotifications
This commit is contained in:
parent
175f65407a
commit
78828edd46
|
|
@ -46,9 +46,10 @@ func (p *NotificationDataStreamProvider) IncrementalSync(
|
|||
if counts == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
jr.UnreadNotifications.HighlightCount = counts.UnreadHighlightCount
|
||||
jr.UnreadNotifications.NotificationCount = counts.UnreadNotificationCount
|
||||
jr.UnreadNotifications = &types.UnreadNotifications{
|
||||
HighlightCount: counts.UnreadHighlightCount,
|
||||
NotificationCount: counts.UnreadNotificationCount,
|
||||
}
|
||||
req.Response.Rooms.Join[roomID] = jr
|
||||
}
|
||||
return to
|
||||
|
|
|
|||
|
|
@ -398,6 +398,11 @@ func (r *Response) IsEmpty() bool {
|
|||
len(r.ToDevice.Events) == 0
|
||||
}
|
||||
|
||||
type UnreadNotifications struct {
|
||||
HighlightCount int `json:"highlight_count"`
|
||||
NotificationCount int `json:"notification_count"`
|
||||
}
|
||||
|
||||
// JoinResponse represents a /sync response for a room which is under the 'join' or 'peek' key.
|
||||
type JoinResponse struct {
|
||||
Summary struct {
|
||||
|
|
@ -419,10 +424,7 @@ type JoinResponse struct {
|
|||
AccountData struct {
|
||||
Events []gomatrixserverlib.ClientEvent `json:"events"`
|
||||
} `json:"account_data"`
|
||||
UnreadNotifications struct {
|
||||
HighlightCount int `json:"highlight_count"`
|
||||
NotificationCount int `json:"notification_count"`
|
||||
} `json:"unread_notifications"`
|
||||
*UnreadNotifications `json:"unread_notifications,omitempty"`
|
||||
}
|
||||
|
||||
// NewJoinResponse creates an empty response with initialised arrays.
|
||||
|
|
|
|||
Loading…
Reference in a new issue