Fix MessagesManager::on_failed_dialog_messages_search.

GitOrigin-RevId: c3abb5a134cf1a393eef17b5a59eb3256cbe1656
This commit is contained in:
levlam 2018-01-31 14:59:14 +03:00
parent e4c464b3c9
commit 0b344f1c74
2 changed files with 10 additions and 3 deletions

View File

@ -1374,7 +1374,7 @@ class SearchMessagesQuery : public Td::ResultHandler {
void on_error(uint64 id, Status status) override {
td->messages_manager_->on_get_dialog_error(dialog_id_, status, "SearchMessagesQuery");
td->messages_manager_->on_failed_dialog_messages_search(random_id_);
td->messages_manager_->on_failed_dialog_messages_search(dialog_id_, random_id_);
promise_.set_error(std::move(status));
}
};
@ -6702,7 +6702,14 @@ void MessagesManager::on_get_dialog_messages_search_result(DialogId dialog_id, c
it->second.first = total_count;
}
void MessagesManager::on_failed_dialog_messages_search(int64 random_id) {
void MessagesManager::on_failed_dialog_messages_search(DialogId dialog_id, int64 random_id) {
if (!dialog_id.is_valid()) {
auto it = found_call_messages_.find(random_id);
CHECK(it != found_call_messages_.end());
found_call_messages_.erase(it);
return;
}
auto it = found_dialog_messages_.find(random_id);
CHECK(it != found_dialog_messages_.end());
found_dialog_messages_.erase(it);

View File

@ -852,7 +852,7 @@ class MessagesManager : public Actor {
MessageId from_message_id, int32 offset, int32 limit,
SearchMessagesFilter filter, int64 random_id, int32 total_count,
vector<tl_object_ptr<telegram_api::Message>> &&messages);
void on_failed_dialog_messages_search(int64 random_id);
void on_failed_dialog_messages_search(DialogId dialog_id, int64 random_id);
void on_get_messages_search_result(const string &query, int32 offset_date, DialogId offset_dialog_id,
MessageId offset_message_id, int32 limit, int64 random_id, int32 total_count,