From 91fb9917bc2743fbd7f98a59b7b0b24367c405e1 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 24 Feb 2020 13:14:29 +0400 Subject: [PATCH] Fix search in chat results loading. --- Telegram/SourceFiles/dialogs/dialogs_widget.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp index 211f01b0d..957baa25e 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_widget.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_widget.cpp @@ -797,9 +797,11 @@ bool Widget::onSearchMessages(bool searchCache) { MTP_int(0) )).done([=](const MTPmessages_Messages &result) { searchReceived(type, result, _searchRequest); + _searchInHistoryRequest = 0; finish(); }).fail([=](const RPCError &error) { searchFailed(type, error, _searchRequest); + _searchInHistoryRequest = 0; finish(); }).send(); _searchQueries.insert(_searchRequest, _searchQuery); @@ -956,8 +958,12 @@ void Widget::onSearchMore() { MTP_int(0) )).done([=](const MTPmessages_Messages &result) { searchReceived(type, result, _searchRequest); + _searchInHistoryRequest = 0; + finish(); }).fail([=](const RPCError &error) { searchFailed(type, error, _searchRequest); + _searchInHistoryRequest = 0; + finish(); }).send(); if (!offsetId) { _searchQueries.insert(_searchRequest, _searchQuery); @@ -1032,8 +1038,12 @@ void Widget::onSearchMore() { MTP_int(0) )).done([=](const MTPmessages_Messages &result) { searchReceived(type, result, _searchRequest); + _searchInHistoryRequest = 0; + finish(); }).fail([=](const RPCError &error) { searchFailed(type, error, _searchRequest); + _searchInHistoryRequest = 0; + finish(); }).send(); return _searchRequest; });