mirror of
https://github.com/matrix-org/dendrite.git
synced 2026-01-15 01:53:09 -06:00
Revert "Add join response if we're actually joined to the room"
This reverts commit 44002e033f.
This commit is contained in:
parent
44002e033f
commit
eedfc4a1fb
|
|
@ -3,8 +3,6 @@ package streams
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/matrix-org/gomatrixserverlib"
|
|
||||||
|
|
||||||
"github.com/matrix-org/dendrite/syncapi/types"
|
"github.com/matrix-org/dendrite/syncapi/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -41,17 +39,12 @@ func (p *NotificationDataStreamProvider) IncrementalSync(
|
||||||
return from
|
return from
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add notification data based on the membership of the user
|
// We're merely decorating existing rooms.
|
||||||
for roomID, counts := range countsByRoom {
|
for roomID, jr := range req.Response.Rooms.Join {
|
||||||
if req.Rooms[roomID] != gomatrixserverlib.Join {
|
counts := countsByRoom[roomID]
|
||||||
|
if counts == nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// If there's no join response, add a new one
|
|
||||||
jr, ok := req.Response.Rooms.Join[roomID]
|
|
||||||
if !ok {
|
|
||||||
jr = *types.NewJoinResponse()
|
|
||||||
}
|
|
||||||
|
|
||||||
jr.UnreadNotifications = &types.UnreadNotifications{
|
jr.UnreadNotifications = &types.UnreadNotifications{
|
||||||
HighlightCount: counts.UnreadHighlightCount,
|
HighlightCount: counts.UnreadHighlightCount,
|
||||||
NotificationCount: counts.UnreadNotificationCount,
|
NotificationCount: counts.UnreadNotificationCount,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue