From 39c1da6642cc3b2b134c9430af300bd4745112e4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 15 May 2024 18:55:39 +0400 Subject: [PATCH] Attempt to fix jump to unread in some cases. --- Telegram/SourceFiles/data/data_replies_list.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Telegram/SourceFiles/data/data_replies_list.cpp b/Telegram/SourceFiles/data/data_replies_list.cpp index 5c1700093..2a962dc1b 100644 --- a/Telegram/SourceFiles/data/data_replies_list.cpp +++ b/Telegram/SourceFiles/data/data_replies_list.cpp @@ -368,6 +368,16 @@ bool RepliesList::buildFromData(not_null viewer) { return viewer->around; } else if (const auto item = lookupRoot()) { return computeInboxReadTillFull(); + } else if (_owningTopic) { + // Somehow we don't want always to jump to computed inboxReadTill + // (this was in the code before, but I don't remember why). + // Maybe in case we "View Thread" from a group we don't really + // want to jump to unread inside thread, cause it isn't defined. + // + // But in case of topics we definitely want to support jumping + // to the first unread, even if it is General topic without the + // actual root message or it is a broken topic without root. + return computeInboxReadTillFull(); } return viewer->around; }();