From 36d3dcd6d8aba68652b3bdb1a71e0a7c04721a3b Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 25 Mar 2020 13:08:08 +0400 Subject: [PATCH] Fix marking scheduled out messages as read. --- Telegram/SourceFiles/history/history.cpp | 3 ++- Telegram/SourceFiles/history/history_item.cpp | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 1197822b9..d1d0bcb43 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -1648,7 +1648,8 @@ std::optional History::countStillUnreadLocal(MsgId readTillId) const { for (const auto &block : blocks) { for (const auto &message : block->messages) { const auto item = message->data(); - if (item->out() || !IsServerMsgId(item->id)) { + if (!IsServerMsgId(item->id) + || (item->out() && !item->isFromScheduled())) { continue; } else if (item->id > readTillId) { break; diff --git a/Telegram/SourceFiles/history/history_item.cpp b/Telegram/SourceFiles/history/history_item.cpp index 4bc32948a..699923e8a 100644 --- a/Telegram/SourceFiles/history/history_item.cpp +++ b/Telegram/SourceFiles/history/history_item.cpp @@ -770,7 +770,9 @@ bool HistoryItem::showNotification() const { if (channel && !channel->amIn()) { return false; } - return (out() || _history->peer->isSelf()) ? isFromScheduled() : unread(); + return (out() || _history->peer->isSelf()) + ? isFromScheduled() + : unread(); } void HistoryItem::markClientSideAsRead() {