diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp index cdfee4540..09bdd1e81 100644 --- a/td/telegram/ConfigManager.cpp +++ b/td/telegram/ConfigManager.cpp @@ -57,6 +57,7 @@ #include "td/utils/tl_parsers.h" #include "td/utils/UInt.h" +#include #include #include #include @@ -997,7 +998,8 @@ void ConfigManager::get_external_link(string &&link, Promise &&promise) auto url = r_url.move_as_ok(); url.protocol_ = HttpUrl::Protocol::Https; - Slice path = Slice(url.query_).truncate(url.query_.find_first_of("?#")); + Slice path = url.query_; + path.truncate(url.query_.find_first_of("?#")); Slice parameters_hash = Slice(url.query_).substr(path.size()); Slice parameters = parameters_hash; parameters.truncate(parameters.find('#')); diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp index 7845108cd..3755a1718 100644 --- a/td/telegram/ContactsManager.cpp +++ b/td/telegram/ContactsManager.cpp @@ -34,7 +34,6 @@ #include "td/telegram/PasswordManager.h" #include "td/telegram/Photo.h" #include "td/telegram/Photo.hpp" -#include "td/telegram/RestrictionReason.h" #include "td/telegram/SecretChatActor.h" #include "td/telegram/SecretChatsManager.h" #include "td/telegram/ServerMessageId.h" @@ -60,6 +59,7 @@ #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/Random.h" +#include "td/utils/Slice.h" #include "td/utils/StringBuilder.h" #include "td/utils/Time.h" #include "td/utils/tl_helpers.h" @@ -1778,7 +1778,7 @@ class GetExportedChatInviteQuery : public Td::ResultHandler { } if (result_ptr.ok()->get_id() != telegram_api::messages_exportedChatInvite::ID) { - LOG(ERROR) << "Receive result for GetExportedChatInviteQuery: " << to_string(result_ptr.ok()); + LOG(ERROR) << "Receive wrong result for GetExportedChatInviteQuery: " << to_string(result_ptr.ok()); return on_error(id, Status::Error(500, "Receive unexpected response")); } @@ -10048,7 +10048,7 @@ void ContactsManager::on_get_user_full(tl_object_ptr &&u register_user_photo(u, user_id, user_full->photo); } - if (user->bot_info_ != nullptr && on_update_bot_info(std::move(user->bot_info_), false)) { + if (on_update_bot_info(std::move(user->bot_info_), false)) { user_full->need_send_update = true; } update_user_full(user_full, user_id); @@ -10143,7 +10143,10 @@ void ContactsManager::on_get_user_photos(UserId user_id, int32 offset, int32 lim } bool ContactsManager::on_update_bot_info(tl_object_ptr &&new_bot_info, bool send_update) { - CHECK(new_bot_info != nullptr); + if (new_bot_info == nullptr) { + return false; + } + UserId user_id(new_bot_info->user_id_); if (!user_id.is_valid()) { LOG(ERROR) << "Receive invalid " << user_id; diff --git a/td/telegram/ContactsManager.h b/td/telegram/ContactsManager.h index 3f411463a..b071e6623 100644 --- a/td/telegram/ContactsManager.h +++ b/td/telegram/ContactsManager.h @@ -43,6 +43,7 @@ #include "td/utils/Hints.h" #include "td/utils/Status.h" #include "td/utils/StringBuilder.h" +#include "td/utils/Time.h" #include #include diff --git a/td/telegram/DialogInviteLink.cpp b/td/telegram/DialogInviteLink.cpp index 58bd468df..7da4b9e33 100644 --- a/td/telegram/DialogInviteLink.cpp +++ b/td/telegram/DialogInviteLink.cpp @@ -7,7 +7,6 @@ #include "td/telegram/DialogInviteLink.h" #include "td/telegram/ContactsManager.h" -#include "td/telegram/Global.h" #include "td/utils/logging.h" #include "td/utils/misc.h" diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 49fbf5655..5114b30bc 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -4629,7 +4629,7 @@ unique_ptr get_action_message_content(Td *td, tl_object_ptr(action); if (set_messages_ttl->period_ < 0) { - LOG(ERROR) << "Receive wrong ttl = " << set_messages_ttl->period_; + LOG(ERROR) << "Receive wrong TTL = " << set_messages_ttl->period_; break; } return td::make_unique(set_messages_ttl->period_); diff --git a/td/telegram/MessageTtlSetting.h b/td/telegram/MessageTtlSetting.h index 5532eaa3c..7a7c9c690 100644 --- a/td/telegram/MessageTtlSetting.h +++ b/td/telegram/MessageTtlSetting.h @@ -6,13 +6,12 @@ // #pragma once -#include "td/telegram/td_api.h" -#include "td/telegram/telegram_api.h" - #include "td/utils/common.h" #include "td/utils/StringBuilder.h" #include "td/utils/tl_helpers.h" +#include + namespace td { class MessageTtlSetting { diff --git a/td/telegram/SuggestedAction.cpp b/td/telegram/SuggestedAction.cpp index f04df3fa9..cae588b1f 100644 --- a/td/telegram/SuggestedAction.cpp +++ b/td/telegram/SuggestedAction.cpp @@ -10,6 +10,8 @@ #include "td/telegram/Global.h" #include "td/telegram/Td.h" +#include "td/actor/actor.h" + #include "td/utils/algorithm.h" #include diff --git a/td/telegram/UpdatesManager.cpp b/td/telegram/UpdatesManager.cpp index 7bf193459..b6f9ba463 100644 --- a/td/telegram/UpdatesManager.cpp +++ b/td/telegram/UpdatesManager.cpp @@ -20,6 +20,7 @@ #include "td/telegram/ContactsManager.h" #include "td/telegram/DialogAction.h" #include "td/telegram/DialogId.h" +#include "td/telegram/DialogInviteLink.h" #include "td/telegram/FolderId.h" #include "td/telegram/Global.h" #include "td/telegram/GroupCallManager.h" @@ -57,6 +58,7 @@ #include "td/utils/Slice.h" #include "td/utils/Status.h" #include "td/utils/StringBuilder.h" +#include "td/utils/Time.h" #include #include