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,14 +159,21 @@ void activateBotCommand(
}
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();
Core::App().hideMediaView();
m->searchMessages(
tag + ' ',
(inPeer && !inPeer->isUser())
? inPeer->owner().history(inPeer).get()
: Dialogs::Key());
if (const auto m = window->mainWidget()) {
m->searchMessages(
tag + ' ',
(inPeer && !inPeer->isUser())
? inPeer->owner().history(inPeer).get()
: Dialogs::Key());
}
}
}