From f8c396e2cf54e61a17d124d533f01151c8c3f7bd Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 17 Aug 2023 15:36:27 +0200 Subject: [PATCH] Fix scheduled outgoing messages unread state. Fixes #17079. --- Telegram/SourceFiles/history/history.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index 5617a099143342..fe5a1a41e0fd1d 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -1262,7 +1262,15 @@ void History::newItemAdded(not_null item) { Core::App().notifications().schedule(notification); } if (item->out()) { - destroyUnreadBar(); + if (item->isFromScheduled() && unreadCountRefreshNeeded(item->id)) { + if (unreadCountKnown()) { + setUnreadCount(unreadCount() + 1); + } else if (!isForum()) { + owner().histories().requestDialogEntry(this); + } + } else { + destroyUnreadBar(); + } if (!item->unread(this)) { outboxRead(item); }