From 76330eaaa654fad1edb4460b12a33a8464b03caa Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 25 Oct 2022 13:05:33 +0400 Subject: [PATCH] Provide a draft from notification to correct thread. --- Telegram/SourceFiles/window/notifications_manager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/window/notifications_manager.cpp b/Telegram/SourceFiles/window/notifications_manager.cpp index 202d90e4f..c6d1e8a12 100644 --- a/Telegram/SourceFiles/window/notifications_manager.cpp +++ b/Telegram/SourceFiles/window/notifications_manager.cpp @@ -985,15 +985,18 @@ void Manager::notificationActivated( id.msgId); const auto topic = item ? item->topic() : nullptr; if (!reply.text.isEmpty()) { - // #TODO forum notifications + const auto topicRootId = topic + ? topic->rootId() + : id.contextId.topicRootId; const auto replyToId = (id.msgId > 0 - && !history->peer->isUser()) + && !history->peer->isUser() + && id.msgId != topicRootId) ? id.msgId : 0; auto draft = std::make_unique( reply, replyToId, - (topic ? topic->rootId() : 0), + topicRootId, MessageCursor{ int(reply.text.size()), int(reply.text.size()),