diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 179fde1f83..4aa3c7dca4 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -2742,6 +2742,11 @@ void Widget::showMainMenu() { } void Widget::searchMessages(SearchState state) { + if (const auto peer = state.inChat.peer()) { + if (_openedForum && peer->forum() != _openedForum) { + controller()->closeForum(); + } + } applySearchState(std::move(state)); session().local().saveRecentSearchHashtags(_searchState.query); }