mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-16 10:33:11 -06:00
Fix broken notification incremental sync
I was not seeing unread notifications in sync, even if they were written to the db Notifications are in their own stream, but the code was trying to tack them onto the join room stream. If the offsets “happened” to line up, you might get a count here or there, but they would be totally wrong (jump from 1 to 0 to 2, etc) To fix, put them in their own top level object, handle them on the client. Signed-off-by: Austin Ellis <austin@hntlabs.com>
This commit is contained in:
parent
fbfde86914
commit
1f2f42494c
|
|
@ -442,6 +442,16 @@ func (r *Response) IsEmpty() bool {
|
|||
len(r.ToDevice.Events) == 0
|
||||
}
|
||||
|
||||
type UnreadNotificationsResponse struct {
|
||||
HighlightCount int `json:"highlight_count"`
|
||||
NotificationCount int `json:"notification_count"`
|
||||
}
|
||||
|
||||
func NewUnreadNotificationsResponse() *UnreadNotificationsResponse {
|
||||
res := UnreadNotificationsResponse{}
|
||||
return &res
|
||||
}
|
||||
|
||||
type UnreadNotifications struct {
|
||||
HighlightCount int `json:"highlight_count"`
|
||||
NotificationCount int `json:"notification_count"`
|
||||
|
|
@ -518,16 +528,6 @@ func NewJoinResponse() *JoinResponse {
|
|||
}
|
||||
}
|
||||
|
||||
type UnreadNotificationsResponse struct {
|
||||
HighlightCount int `json:"highlight_count"`
|
||||
NotificationCount int `json:"notification_count"`
|
||||
}
|
||||
|
||||
func NewUnreadNotificationsResponse() *UnreadNotificationsResponse {
|
||||
res := UnreadNotificationsResponse{}
|
||||
return &res
|
||||
}
|
||||
|
||||
// InviteResponse represents a /sync response for a room which is under the 'invite' key.
|
||||
type InviteResponse struct {
|
||||
InviteState struct {
|
||||
|
|
|
|||
Loading…
Reference in a new issue