Update channel count when markin items read

This commit is contained in:
Peter Stuifzand 2018-04-10 20:44:47 +02:00
parent fc4400a3c8
commit 0ef60c5a4c

View File

@ -634,5 +634,13 @@ func (b *memoryBackend) MarkRead(channel string, uids []string) {
log.Printf("Marking read for channel %s has failed\n", channel)
}
unread, _ := redis.Int(conn.Do("ZCARD", channelKey))
unread -= len(uids)
if ch, e := b.Channels[channel]; e {
ch.Unread = unread
b.Channels[channel] = ch
}
log.Printf("Marking read success for %s %v\n", channel, itemUIDs)
}