From adb10460b2733daf4925ea1c224cdd8a0417b4e0 Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 23 Dec 2019 20:48:30 +0300 Subject: [PATCH] Minor fixes. GitOrigin-RevId: 0c678ad195683947355b63af5aff49875312b4a3 --- td/telegram/AuthManager.cpp | 6 +++--- td/telegram/AuthManager.h | 1 - td/telegram/BackgroundType.cpp | 1 + td/telegram/BackgroundType.h | 2 +- td/telegram/ConfigManager.h | 1 + td/telegram/Payments.cpp | 1 + td/telegram/files/FileManager.h | 1 + td/telegram/net/DcAuthManager.cpp | 1 - td/telegram/net/NetQueryDispatcher.cpp | 1 + td/telegram/net/TempAuthKeyWatchdog.h | 1 + tdutils/test/json.cpp | 1 - test/message_entities.cpp | 1 + 12 files changed, 11 insertions(+), 7 deletions(-) diff --git a/td/telegram/AuthManager.cpp b/td/telegram/AuthManager.cpp index d23dec7b1..44c2a1173 100644 --- a/td/telegram/AuthManager.cpp +++ b/td/telegram/AuthManager.cpp @@ -23,7 +23,6 @@ #include "td/telegram/Td.h" #include "td/telegram/TdDb.h" #include "td/telegram/TopDialogManager.h" -#include "td/telegram/UniqueId.h" #include "td/telegram/UpdatesManager.h" #include "td/actor/PromiseFuture.h" @@ -31,6 +30,7 @@ #include "td/utils/base64.h" #include "td/utils/format.h" #include "td/utils/logging.h" +#include "td/utils/misc.h" #include "td/utils/ScopeGuard.h" #include "td/utils/Slice.h" #include "td/utils/Time.h" @@ -488,7 +488,7 @@ void AuthManager::on_request_qr_code_result(NetQueryPtr &result, bool is_import) if (query_id_ != 0) { on_query_error(std::move(status)); } else { - login_code_retry_delay_ = td::clamp(2 * login_code_retry_delay_, 1, 60); + login_code_retry_delay_ = clamp(2 * login_code_retry_delay_, 1, 60); set_login_token_expires_at(Time::now() + login_code_retry_delay_); } } @@ -574,7 +574,7 @@ void AuthManager::on_get_password_result(NetQueryPtr &result) { } } else if (was_qr_code_request_) { imported_dc_id_ = -1; - login_code_retry_delay_ = td::clamp(2 * login_code_retry_delay_, 1, 60); + login_code_retry_delay_ = clamp(2 * login_code_retry_delay_, 1, 60); set_login_token_expires_at(Time::now() + login_code_retry_delay_); return; } else { diff --git a/td/telegram/AuthManager.h b/td/telegram/AuthManager.h index f3003debe..344159aec 100644 --- a/td/telegram/AuthManager.h +++ b/td/telegram/AuthManager.h @@ -15,7 +15,6 @@ #include "td/telegram/telegram_api.h" #include "td/actor/actor.h" -#include "td/actor/PromiseFuture.h" #include "td/actor/Timeout.h" #include "td/utils/common.h" diff --git a/td/telegram/BackgroundType.cpp b/td/telegram/BackgroundType.cpp index a986ef86d..057ecc17b 100644 --- a/td/telegram/BackgroundType.cpp +++ b/td/telegram/BackgroundType.cpp @@ -7,6 +7,7 @@ #include "td/telegram/BackgroundType.h" #include "td/utils/logging.h" +#include "td/utils/Slice.h" namespace td { diff --git a/td/telegram/BackgroundType.h b/td/telegram/BackgroundType.h index 0d633beae..05ef04397 100644 --- a/td/telegram/BackgroundType.h +++ b/td/telegram/BackgroundType.h @@ -57,7 +57,7 @@ struct BackgroundType { BackgroundType(bool is_moving, const BackgroundFill &fill, int32 intensity) : type(Type::Pattern), is_moving(is_moving), intensity(intensity), fill(fill) { } - BackgroundType(BackgroundFill fill) : type(Type::Fill), fill(fill) { + explicit BackgroundType(BackgroundFill fill) : type(Type::Fill), fill(fill) { } bool is_server() const { diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h index d2b7b79be..23a4f1582 100644 --- a/td/telegram/ConfigManager.h +++ b/td/telegram/ConfigManager.h @@ -16,6 +16,7 @@ #include "td/actor/actor.h" #include "td/actor/PromiseFuture.h" +#include "td/utils/common.h" #include "td/utils/logging.h" #include "td/utils/port/IPAddress.h" #include "td/utils/Slice.h" diff --git a/td/telegram/Payments.cpp b/td/telegram/Payments.cpp index b7c4f93ea..5ac5309d2 100644 --- a/td/telegram/Payments.cpp +++ b/td/telegram/Payments.cpp @@ -12,6 +12,7 @@ #include "td/telegram/ContactsManager.h" #include "td/telegram/Global.h" #include "td/telegram/misc.h" +#include "td/telegram/net/DcId.h" #include "td/telegram/PasswordManager.h" #include "td/telegram/Td.h" #include "td/telegram/UpdatesManager.h" diff --git a/td/telegram/files/FileManager.h b/td/telegram/files/FileManager.h index aab1bc557..1ad3d840b 100644 --- a/td/telegram/files/FileManager.h +++ b/td/telegram/files/FileManager.h @@ -33,6 +33,7 @@ #include "td/utils/optional.h" #include "td/utils/Slice.h" #include "td/utils/Status.h" +#include "td/utils/StringBuilder.h" #include #include diff --git a/td/telegram/net/DcAuthManager.cpp b/td/telegram/net/DcAuthManager.cpp index 3ce9a8f44..20ad465bb 100644 --- a/td/telegram/net/DcAuthManager.cpp +++ b/td/telegram/net/DcAuthManager.cpp @@ -18,7 +18,6 @@ #include "td/telegram/telegram_api.h" -#include "td/utils/format.h" #include "td/utils/logging.h" #include "td/utils/misc.h" diff --git a/td/telegram/net/NetQueryDispatcher.cpp b/td/telegram/net/NetQueryDispatcher.cpp index e87477822..d4c9d4a87 100644 --- a/td/telegram/net/NetQueryDispatcher.cpp +++ b/td/telegram/net/NetQueryDispatcher.cpp @@ -18,6 +18,7 @@ #include "td/telegram/Global.h" #include "td/telegram/Td.h" #include "td/telegram/TdDb.h" +#include "td/telegram/telegram_api.h" #include "td/utils/common.h" #include "td/utils/format.h" diff --git a/td/telegram/net/TempAuthKeyWatchdog.h b/td/telegram/net/TempAuthKeyWatchdog.h index d25062c28..0a6c1ed3b 100644 --- a/td/telegram/net/TempAuthKeyWatchdog.h +++ b/td/telegram/net/TempAuthKeyWatchdog.h @@ -9,6 +9,7 @@ #include "td/actor/actor.h" #include "td/telegram/Global.h" +#include "td/telegram/net/DcId.h" #include "td/telegram/net/NetQueryCreator.h" #include "td/telegram/net/NetQueryDispatcher.h" diff --git a/tdutils/test/json.cpp b/tdutils/test/json.cpp index effa5e012..388c9e9f0 100644 --- a/tdutils/test/json.cpp +++ b/tdutils/test/json.cpp @@ -11,7 +11,6 @@ #include "td/utils/Slice.h" #include "td/utils/StringBuilder.h" -#include #include REGISTER_TESTS(json) diff --git a/test/message_entities.cpp b/test/message_entities.cpp index 96befe50b..780643bf8 100644 --- a/test/message_entities.cpp +++ b/test/message_entities.cpp @@ -9,6 +9,7 @@ #include "td/utils/common.h" #include "td/utils/format.h" #include "td/utils/logging.h" +#include "td/utils/misc.h" #include "td/utils/Slice.h" #include "td/utils/tests.h" #include "td/utils/utf8.h"