Update comments

This commit is contained in:
Till Faelligen 2022-09-26 10:50:57 +02:00
parent 125f3e64de
commit 76e78cb6e4
No known key found for this signature in database
GPG key ID: 3DF82D8AB9211D4E

View file

@ -32,7 +32,6 @@ func (p *NotificationDataStreamProvider) IncrementalSync(
req *types.SyncRequest,
from, _ types.StreamPosition,
) types.StreamPosition {
// We want counts for all possible rooms, so always start from zero.
to := p.LatestPosition(ctx)
countsByRoom, err := p.DB.GetUserUnreadNotificationCounts(ctx, req.Device.UserID, from, to)
if err != nil {
@ -40,8 +39,7 @@ func (p *NotificationDataStreamProvider) IncrementalSync(
return from
}
// Add notification data to rooms.
// Create an empty JoinResponse if the room isn't in this response
// We're merely decorating existing rooms.
for roomID, jr := range req.Response.Rooms.Join {
counts := countsByRoom[roomID]
if counts == nil {