mirror of https://github.com/procxx/kepka.git
Force zero unread count if read till end.
This commit is contained in:
parent
f2ef109940
commit
c3463dec63
|
@ -135,6 +135,17 @@ void Histories::readInboxTill(
|
||||||
bool force) {
|
bool force) {
|
||||||
Expects(IsServerMsgId(tillId) || (!tillId && !force));
|
Expects(IsServerMsgId(tillId) || (!tillId && !force));
|
||||||
|
|
||||||
|
const auto syncGuard = gsl::finally([&] {
|
||||||
|
if (history->unreadCount() > 0) {
|
||||||
|
if (const auto last = history->lastServerMessage()) {
|
||||||
|
if (last->id == tillId) {
|
||||||
|
history->setUnreadCount(0);
|
||||||
|
history->updateChatListEntry();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
history->session().notifications().clearIncomingFromHistory(history);
|
history->session().notifications().clearIncomingFromHistory(history);
|
||||||
|
|
||||||
const auto needsRequest = history->readInboxTillNeedsRequest(tillId);
|
const auto needsRequest = history->readInboxTillNeedsRequest(tillId);
|
||||||
|
|
Loading…
Reference in New Issue