diff --git a/telegram-bot-api/Client.cpp b/telegram-bot-api/Client.cpp index 61e357c..e9b0721 100644 --- a/telegram-bot-api/Client.cpp +++ b/telegram-bot-api/Client.cpp @@ -5417,12 +5417,12 @@ td::Result> Client::get_keyboard_butt auto restrict_chat_has_username = has_json_object_field(request_chat_object, "chat_has_username"); TRY_RESULT(chat_has_username, get_json_object_bool_field(request_chat_object, "chat_has_username")); TRY_RESULT(chat_is_created, get_json_object_bool_field(request_chat_object, "chat_is_created")); - td_api::object_ptr user_administrator_rights; + object_ptr user_administrator_rights; if (has_json_object_field(request_chat_object, "user_administrator_rights")) { TRY_RESULT_ASSIGN(user_administrator_rights, get_chat_administrator_rights(get_json_object_field_force( request_chat_object, "user_administrator_rights"))); } - td_api::object_ptr bot_administrator_rights; + object_ptr bot_administrator_rights; if (has_json_object_field(request_chat_object, "bot_administrator_rights")) { TRY_RESULT_ASSIGN(bot_administrator_rights, get_chat_administrator_rights(get_json_object_field_force( request_chat_object, "bot_administrator_rights"))); @@ -6476,7 +6476,7 @@ td::Result> Client::get_bot_menu_butto TRY_RESULT(type, get_json_object_string_field(object, "type", false)); if (type == "default") { - return td_api::make_object("", "default"); + return make_object("", "default"); } if (type == "commands") { return nullptr; @@ -6486,7 +6486,7 @@ td::Result> Client::get_bot_menu_butto TRY_RESULT(web_app, get_json_object_field(object, "web_app", td::JsonValue::Type::Object, false)); auto &web_app_object = web_app.get_object(); TRY_RESULT(url, get_json_object_string_field(web_app_object, "url", false)); - return td_api::make_object(text, url); + return make_object(text, url); } return td::Status::Error(400, "MenuButton has unsupported type"); @@ -6495,7 +6495,7 @@ td::Result> Client::get_bot_menu_butto td::Result> Client::get_bot_menu_button(const Query *query) { auto menu_button = query->arg("menu_button"); if (menu_button.empty()) { - return td_api::make_object("", "default"); + return make_object("", "default"); } LOG(INFO) << "Parsing JSON object: " << menu_button; @@ -8976,7 +8976,7 @@ td::Status Client::process_set_chat_administrator_custom_title_query(PromisedQue if (chat_member->status_->get_id() != td_api::chatMemberStatusAdministrator::ID) { return fail_query(400, "Bad Request: user is not an administrator", std::move(query)); } - auto administrator = td_api::move_object_as(chat_member->status_); + auto administrator = move_object_as(chat_member->status_); if (!administrator->can_be_edited_) { return fail_query(400, "Bad Request: not enough rights to change custom title of the user", std::move(query)); @@ -9195,7 +9195,7 @@ td::Status Client::process_get_custom_emoji_stickers_query(PromisedQueryPtr &que td::Status Client::process_upload_sticker_file_query(PromisedQueryPtr &query) { TRY_RESULT(user_id, get_user_id(query.get())); object_ptr sticker_format; - td_api::object_ptr sticker; + object_ptr sticker; if (query->has_arg("sticker") || query->file("sticker") != nullptr) { TRY_RESULT_ASSIGN(sticker_format, get_sticker_format(query->arg("sticker_format"))); sticker = get_input_file(query.get(), "sticker", true); diff --git a/telegram-bot-api/Client.h b/telegram-bot-api/Client.h index df98b5e..4ec4eb9 100644 --- a/telegram-bot-api/Client.h +++ b/telegram-bot-api/Client.h @@ -368,10 +368,10 @@ class Client final : public WebhookActor::Callback { struct BotCommandScope { object_ptr scope_; td::string chat_id_; - td::int64 user_id_ = 0; + int64 user_id_ = 0; explicit BotCommandScope(object_ptr scope, td::string chat_id = td::string(), - td::int64 user_id = 0) + int64 user_id = 0) : scope_(std::move(scope)), chat_id_(std::move(chat_id)), user_id_(user_id) { } }; @@ -868,8 +868,7 @@ class Client final : public WebhookActor::Callback { struct FullMessageIdHash { td::uint32 operator()(FullMessageId full_message_id) const { - return td::Hash()(full_message_id.chat_id) * 2023654985u + - td::Hash()(full_message_id.message_id); + return td::Hash()(full_message_id.chat_id) * 2023654985u + td::Hash()(full_message_id.message_id); } };