From 9dc83f2594ad691608902c8a1f78b225cfdb7548 Mon Sep 17 00:00:00 2001 From: levlam Date: Tue, 12 Mar 2024 14:39:03 +0300 Subject: [PATCH] tg_cli: add updateNewBusinessMessage handling. --- td/telegram/cli.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index fd964d973..f0fcb6c44 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -1505,6 +1505,20 @@ class CliClient final : public Actor { } break; } + case td_api::updateNewBusinessMessage::ID: { + const auto *update = static_cast(result.get()); + const auto *message = update->message_.get(); + if (!message->is_outgoing_ && use_test_dc_) { + auto old_business_connection_id = std::move(business_connection_id_); + business_connection_id_ = update->connection_id_; + send_message(message->chat_id_, + td_api::make_object(as_formatted_text("Welcome!"), + get_link_preview_options(), true), + false, false); + business_connection_id_ = std::move(old_business_connection_id); + } + break; + } case td_api::file::ID: on_get_file(*static_cast(result.get())); break;