Fix opening hashtag when in archive

This commit is contained in:
RadRussianRus 2020-01-26 05:48:42 +03:00 committed by John Preston
parent 07560188cf
commit 327c9caed7
1 changed files with 13 additions and 6 deletions

View File

@ -159,9 +159,15 @@ void activateBotCommand(
} }
void searchByHashtag(const QString &tag, PeerData *inPeer) { void searchByHashtag(const QString &tag, PeerData *inPeer) {
if (const auto m = App::main()) { if (const auto window = App::wnd()) {
if (const auto controller = window->sessionController()) {
if (controller->openedFolder().current()) {
controller->closeFolder();
}
}
Ui::hideSettingsAndLayer(); Ui::hideSettingsAndLayer();
Core::App().hideMediaView(); Core::App().hideMediaView();
if (const auto m = window->mainWidget()) {
m->searchMessages( m->searchMessages(
tag + ' ', tag + ' ',
(inPeer && !inPeer->isUser()) (inPeer && !inPeer->isUser())
@ -169,6 +175,7 @@ void searchByHashtag(const QString &tag, PeerData *inPeer) {
: Dialogs::Key()); : Dialogs::Key());
} }
} }
}
void showSettings() { void showSettings() {
if (auto w = App::wnd()) { if (auto w = App::wnd()) {