From 14fbdf592842b947701acd052d363dda5000ee1e Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 13 Jan 2023 17:47:08 +0300 Subject: [PATCH] Forcely load chosen chat from database. --- td/telegram/MessagesManager.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index f321296ab..737a7e422 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -29749,7 +29749,7 @@ void MessagesManager::do_send_screenshot_taken_notification_message(DialogId dia void MessagesManager::send_chosen_dialog(FullMessageId full_message_id, int32 button_id, DialogId chosen_dialog_id, Promise &&promise) { - const Message *m = get_message_force(full_message_id, "send_chosen_user"); + const Message *m = get_message_force(full_message_id, "send_chosen_dialog"); if (m == nullptr) { return promise.set_error(Status::Error(400, "Message not found")); } @@ -29757,6 +29757,9 @@ void MessagesManager::send_chosen_dialog(FullMessageId full_message_id, int32 bu return promise.set_error(Status::Error(400, "Message has no buttons")); } CHECK(m->message_id.is_valid() && m->message_id.is_server()); + if (chosen_dialog_id.get_type() != DialogType::User) { + get_dialog_force(chosen_dialog_id, "send_chosen_dialog"); + } TRY_STATUS_PROMISE(promise, m->reply_markup->check_chosen_dialog(td_, button_id, chosen_dialog_id)); td_->create_handler(std::move(promise))->send(full_message_id, button_id, chosen_dialog_id);