From 046ed45152da5d0b8114378c522447d8f3da135f Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 7 Mar 2024 14:09:31 +0300 Subject: [PATCH] Various fixes. --- td/generate/scheme/td_api.tl | 2 +- td/telegram/BusinessWorkHours.h | 2 -- td/telegram/MessagesManager.cpp | 2 +- td/telegram/QuickReplyManager.cpp | 6 ++---- td/telegram/Td.cpp | 2 +- td/telegram/cli.cpp | 2 +- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index eae8fee0c..f69bcddef 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -6657,7 +6657,7 @@ updateQuickReplyShortcuts shortcut_ids:vector = Update; //@description The list of quick reply shortcut messages has changed //@shortcut_id The identifier of the shortcut -//@messages The new list of quick reply messages for the shortcut in order from the first to the last sent +//@messages The new list of quick reply messages for the shortcut in order from the first to the last sent updateQuickReplyShortcutMessages shortcut_id:int32 messages:vector = Update; //@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic diff --git a/td/telegram/BusinessWorkHours.h b/td/telegram/BusinessWorkHours.h index a14f3ee57..4fcdda277 100644 --- a/td/telegram/BusinessWorkHours.h +++ b/td/telegram/BusinessWorkHours.h @@ -14,8 +14,6 @@ namespace td { -class Td; - class BusinessWorkHours { public: BusinessWorkHours() = default; diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index a2d27d10f..d749b79ba 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -26646,7 +26646,7 @@ Result> MessagesManager::send_quick_reply_s TRY_RESULT(message_contents, td_->quick_reply_manager_->get_quick_reply_message_contents(dialog_id, shortcut_id)); if (message_contents.empty()) { - return td_api::object_ptr(); + return td_api::make_object(); } std::unordered_map, Hash> new_media_album_ids; diff --git a/td/telegram/QuickReplyManager.cpp b/td/telegram/QuickReplyManager.cpp index b7704d39d..4d16e4b55 100644 --- a/td/telegram/QuickReplyManager.cpp +++ b/td/telegram/QuickReplyManager.cpp @@ -479,7 +479,7 @@ Status QuickReplyManager::check_shortcut_name(CSlice name) { length++; } if (length == 0) { - return Status::Error("Name can't be empty"); + return Status::Error("Name must be non-empty"); } if (length > 32) { return Status::Error("Name is too long"); @@ -1305,9 +1305,7 @@ void QuickReplyManager::on_reload_quick_reply_messages( if (s == nullptr) { return fail_promises(promises, Status::Error(400, "Shortcut not found")); } - for (auto &promise : promises) { - promise.set_value(Unit()); - } + set_promises(promises); } int64 QuickReplyManager::get_quick_reply_messages_hash(const Shortcut *s) { diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 6e94cb821..4d361f23e 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -9618,7 +9618,7 @@ td_api::object_ptr Td::do_static_request(const td_api::checkQuic if (status.is_ok()) { return td_api::make_object(); } - return make_error(200, status.error().message()); + return make_error(200, status.message()); } td_api::object_ptr Td::do_static_request(const td_api::getCountryFlagEmoji &request) { diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index b197ed502..17061ace5 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -946,7 +946,7 @@ class CliClient final : public Actor { } vector as_shortcut_ids(Slice shortcut_ids) const { - return transform(autosplit(shortcut_ids), [](Slice str) { return as_shortcut_id(str); }); + return transform(autosplit(shortcut_ids), as_shortcut_id); } td_api::object_ptr get_input_message_reply_to() const {