Don't allow unread count to go below zero
This commit is contained in:
parent
59a784f326
commit
b7b706368a
|
@ -716,6 +716,9 @@ func (b *memoryBackend) MarkRead(channel string, uids []string) {
|
||||||
unread -= len(uids)
|
unread -= len(uids)
|
||||||
|
|
||||||
if ch, e := b.Channels[channel]; e {
|
if ch, e := b.Channels[channel]; e {
|
||||||
|
if unread < 0 {
|
||||||
|
unread = 0
|
||||||
|
}
|
||||||
ch.Unread = unread
|
ch.Unread = unread
|
||||||
b.Channels[channel] = ch
|
b.Channels[channel] = ch
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user