From 1a16f0ea9f171d783b4d6c49d0e2d37c5e02a7cf Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 14 Mar 2019 22:31:37 +0300 Subject: [PATCH] Add source to MessagesManager::have_message. GitOrigin-RevId: 0354e12de9ca1316541b084a91b1810522ca44bd --- td/telegram/CallbackQueriesManager.cpp | 2 +- td/telegram/MessagesManager.cpp | 14 +++++++------- td/telegram/MessagesManager.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/td/telegram/CallbackQueriesManager.cpp b/td/telegram/CallbackQueriesManager.cpp index 46ec1742..3e5eb466 100644 --- a/td/telegram/CallbackQueriesManager.cpp +++ b/td/telegram/CallbackQueriesManager.cpp @@ -237,7 +237,7 @@ int64 CallbackQueriesManager::send_callback_query(FullMessageId full_message_id, return 0; } - if (!td_->messages_manager_->have_message(full_message_id)) { + if (!td_->messages_manager_->have_message(full_message_id, "send_callback_query")) { promise.set_error(Status::Error(5, "Message not found")); return 0; } diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index cba301ef..5abd079b 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -6620,7 +6620,7 @@ void MessagesManager::after_get_difference() { // fallthrough case DialogType::User: case DialogType::Chat: - if (!have_message({dialog_id, it.second})) { + if (!have_message({dialog_id, it.second}, "after get difference")) { // The sent message has already been deleted by the user or sent to inaccessible channel. // The sent message may never be received, but we will need updateMessageId in case the message is received // to delete it from the server and to not add to the chat. @@ -11745,8 +11745,8 @@ void MessagesManager::on_get_common_dialogs(UserId user_id, vectorcontent.get()); - if (message_id.is_valid() && !have_message({d->dialog_id, message_id})) { + if (message_id.is_valid() && !have_message({d->dialog_id, message_id}, "add_new_message_notification")) { missing_pinned_message_id = message_id; } } @@ -20809,7 +20809,7 @@ void MessagesManager::pin_dialog_message(DialogId dialog_id, MessageId message_i if (is_unpin) { CHECK(message_id == MessageId()); } else { - if (!have_message({dialog_id, message_id})) { + if (!have_message({dialog_id, message_id}, "pin_dialog_message")) { return promise.set_error(Status::Error(6, "Message not found")); } @@ -21829,13 +21829,13 @@ MessagesManager::Message *MessagesManager::add_message_to_dialog(Dialog *d, uniq get_dialog_notification_group_id(d->dialog_id, get_notification_group_info(d, message.get())); auto pinned_message_id = get_message_content_pinned_message_id(message->content.get()); - if (pinned_message_id.is_valid() && have_message({dialog_id, pinned_message_id})) { + if (pinned_message_id.is_valid() && have_message({dialog_id, pinned_message_id}, "preload pinned message")) { LOG(INFO) << "Preloaded pinned " << pinned_message_id << " from database"; } } if (*need_update) { if (d->pinned_message_notification_message_id.is_valid() && - have_message({dialog_id, d->pinned_message_notification_message_id})) { + have_message({dialog_id, d->pinned_message_notification_message_id}, "preload previously pinned message")) { LOG(INFO) << "Preloaded previously pinned " << d->pinned_message_notification_message_id << " from database"; } } diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 90586b03..8f4b5d03 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -465,7 +465,7 @@ class MessagesManager : public Actor { vector get_common_dialogs(UserId user_id, DialogId offset_dialog_id, int32 limit, bool force, Promise &&promise); - bool have_message(FullMessageId full_message_id); + bool have_message(FullMessageId full_message_id, const char *source); void get_message(FullMessageId full_message_id, Promise &&promise);