From e42af74dd2e83ba4a71d1b72ff16f215ffae4167 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 1 Oct 2020 13:15:10 +0300 Subject: [PATCH] Don't try to open comments in invite peek channel. --- .../SourceFiles/history/view/history_view_message.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index a03055ce42..29e87d4741 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -1309,7 +1309,15 @@ ClickHandlerPtr Message::createGoToCommentsLink() const { if (const auto window = App::wnd()) { if (const auto controller = window->sessionController()) { if (const auto item = controller->session().data().message(fullId)) { - controller->showRepliesForMessage(item->history(), item->id); + const auto history = item->history(); + if (const auto channel = history->peer->asChannel()) { + if (channel->invitePeekExpires()) { + Ui::Toast::Show( + tr::lng_channel_invite_private(tr::now)); + return; + } + } + controller->showRepliesForMessage(history, item->id); } } }