diff --git a/benchmark/bench_misc.cpp b/benchmark/bench_misc.cpp index f0a4bea06..34eda6633 100644 --- a/benchmark/bench_misc.cpp +++ b/benchmark/bench_misc.cpp @@ -17,6 +17,7 @@ #include "td/utils/port/thread.h" #include "td/utils/Slice.h" #include "td/utils/SliceBuilder.h" +#include "td/utils/Status.h" #include "td/utils/ThreadSafeCounter.h" #include "td/telegram/telegram_api.h" @@ -422,7 +423,7 @@ std::atomic AtomicCounterBench::counter_; #endif -class MessageIdDuplicateCheckerOld { +class IdDuplicateCheckerOld { public: static td::string get_description() { return "Old"; @@ -453,7 +454,7 @@ class MessageIdDuplicateCheckerOld { }; template -class MessageIdDuplicateCheckerNew { +class IdDuplicateCheckerNew { public: static td::string get_description() { return PSTRING() << "New" << MAX_SAVED_MESSAGE_IDS; @@ -480,7 +481,7 @@ class MessageIdDuplicateCheckerNew { std::set saved_message_ids_; }; -class MessageIdDuplicateCheckerNewOther { +class IdDuplicateCheckerNewOther { public: static td::string get_description() { return "NewOther"; @@ -507,7 +508,7 @@ class MessageIdDuplicateCheckerNewOther { std::set saved_message_ids_; }; -class MessageIdDuplicateCheckerNewSimple { +class IdDuplicateCheckerNewSimple { public: static td::string get_description() { return "NewSimple"; @@ -534,7 +535,7 @@ class MessageIdDuplicateCheckerNewSimple { }; template -class MessageIdDuplicateCheckerArray { +class IdDuplicateCheckerArray { public: static td::string get_description() { return PSTRING() << "Array" << max_size; @@ -650,38 +651,38 @@ class DuplicateCheckerBenchEvenOdd final : public td::Benchmark { int main() { SET_VERBOSITY_LEVEL(VERBOSITY_NAME(DEBUG)); - td::bench(DuplicateCheckerBenchEvenOdd>()); - td::bench(DuplicateCheckerBenchEvenOdd>()); - td::bench(DuplicateCheckerBenchEvenOdd>()); - td::bench(DuplicateCheckerBenchEvenOdd>()); + td::bench(DuplicateCheckerBenchEvenOdd>()); + td::bench(DuplicateCheckerBenchEvenOdd>()); + td::bench(DuplicateCheckerBenchEvenOdd>()); + td::bench(DuplicateCheckerBenchEvenOdd>()); - td::bench(DuplicateCheckerBenchReverse>()); - td::bench(DuplicateCheckerBenchReverse>()); - td::bench(DuplicateCheckerBenchReverse>()); - td::bench(DuplicateCheckerBenchReverse>()); + td::bench(DuplicateCheckerBenchReverse>()); + td::bench(DuplicateCheckerBenchReverse>()); + td::bench(DuplicateCheckerBenchReverse>()); + td::bench(DuplicateCheckerBenchReverse>()); - td::bench(DuplicateCheckerBenchRepeatOnly>()); - td::bench(DuplicateCheckerBenchRepeatOnly>()); - td::bench(DuplicateCheckerBenchRepeatOnly>()); - td::bench(DuplicateCheckerBenchRepeatOnly>()); + td::bench(DuplicateCheckerBenchRepeatOnly>()); + td::bench(DuplicateCheckerBenchRepeatOnly>()); + td::bench(DuplicateCheckerBenchRepeatOnly>()); + td::bench(DuplicateCheckerBenchRepeatOnly>()); - td::bench(DuplicateCheckerBenchRepeat()); - td::bench(DuplicateCheckerBenchRepeat>()); - td::bench(DuplicateCheckerBenchRepeat()); - td::bench(DuplicateCheckerBenchRepeat()); - td::bench(DuplicateCheckerBenchRepeat>()); - td::bench(DuplicateCheckerBenchRepeat>()); - td::bench(DuplicateCheckerBenchRepeat>()); + td::bench(DuplicateCheckerBenchRepeat()); + td::bench(DuplicateCheckerBenchRepeat>()); + td::bench(DuplicateCheckerBenchRepeat()); + td::bench(DuplicateCheckerBenchRepeat()); + td::bench(DuplicateCheckerBenchRepeat>()); + td::bench(DuplicateCheckerBenchRepeat>()); + td::bench(DuplicateCheckerBenchRepeat>()); - td::bench(DuplicateCheckerBench()); - td::bench(DuplicateCheckerBench>()); - td::bench(DuplicateCheckerBench()); - td::bench(DuplicateCheckerBench()); - td::bench(DuplicateCheckerBench>()); - td::bench(DuplicateCheckerBench>()); - td::bench(DuplicateCheckerBench>()); - td::bench(DuplicateCheckerBench>()); - td::bench(DuplicateCheckerBench>()); + td::bench(DuplicateCheckerBench()); + td::bench(DuplicateCheckerBench>()); + td::bench(DuplicateCheckerBench()); + td::bench(DuplicateCheckerBench()); + td::bench(DuplicateCheckerBench>()); + td::bench(DuplicateCheckerBench>()); + td::bench(DuplicateCheckerBench>()); + td::bench(DuplicateCheckerBench>()); + td::bench(DuplicateCheckerBench>()); #if !TD_THREAD_UNSUPPORTED for (int i = 1; i <= 16; i *= 2) { diff --git a/example/cpp/td_example.cpp b/example/cpp/td_example.cpp index 88d1c0fcc..95ed53eb5 100644 --- a/example/cpp/td_example.cpp +++ b/example/cpp/td_example.cpp @@ -11,7 +11,6 @@ #include #include #include -#include #include #include #include diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 590c4e847..e6447ec34 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1776,7 +1776,7 @@ messagePinMessage message_id:int53 = MessageContent; //@description A screenshot of a message in the chat has been taken messageScreenshotTaken = MessageContent; -//@description The in the chat has been changed @theme_name New message TTL setting +//@description A theme in the chat has been changed @theme_name If non-empty, name of the new theme set for the chat. Otherwise theme was deleted in the chat messageChatSetTheme theme_name:string = MessageContent; //@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL setting diff --git a/td/mtproto/SessionConnection.cpp b/td/mtproto/SessionConnection.cpp index 6ac30a068..6958d5631 100644 --- a/td/mtproto/SessionConnection.cpp +++ b/td/mtproto/SessionConnection.cpp @@ -31,7 +31,6 @@ #include #include -#include namespace td { diff --git a/td/telegram/CountryInfoManager.cpp b/td/telegram/CountryInfoManager.cpp index ac561434a..e1620af80 100644 --- a/td/telegram/CountryInfoManager.cpp +++ b/td/telegram/CountryInfoManager.cpp @@ -18,8 +18,6 @@ #include "td/utils/logging.h" #include "td/utils/misc.h" #include "td/utils/Random.h" -#include "td/utils/Slice.h" -#include "td/utils/Status.h" #include "td/utils/Time.h" #include "td/utils/tl_parsers.h" diff --git a/td/telegram/CountryInfoManager.h b/td/telegram/CountryInfoManager.h index 98e747c1c..3b4f83a1d 100644 --- a/td/telegram/CountryInfoManager.h +++ b/td/telegram/CountryInfoManager.h @@ -13,6 +13,7 @@ #include "td/actor/PromiseFuture.h" #include "td/utils/common.h" +#include "td/utils/Slice.h" #include "td/utils/Status.h" #include diff --git a/td/telegram/DocumentsManager.cpp b/td/telegram/DocumentsManager.cpp index d2809e191..a4e995d6b 100644 --- a/td/telegram/DocumentsManager.cpp +++ b/td/telegram/DocumentsManager.cpp @@ -27,7 +27,6 @@ #include "td/telegram/VoiceNotesManager.h" #include "td/utils/common.h" -#include "td/utils/format.h" #include "td/utils/HttpUrl.h" #include "td/utils/logging.h" #include "td/utils/MimeType.h" diff --git a/td/telegram/MessageContent.cpp b/td/telegram/MessageContent.cpp index 580e4329c..492e8efe2 100644 --- a/td/telegram/MessageContent.cpp +++ b/td/telegram/MessageContent.cpp @@ -84,6 +84,7 @@ #include "td/utils/tl_helpers.h" #include "td/utils/utf8.h" +#include #include namespace td { diff --git a/td/telegram/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index 42f241c66..c4e555483 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -1873,7 +1873,7 @@ Result> parse_markdown(string &text) { case '[': { string url; if (text[i + 1] != '(') { - // use text as a url + // use text as a URL url.assign(text, begin_pos + 1, i - begin_pos - 1); } else { i += 2; @@ -2070,7 +2070,7 @@ static Result> do_parse_markdown_v2(CSlice text, string &r case MessageEntity::Type::TextUrl: { string url; if (text[i + 1] != '(') { - // use text as a url + // use text as a URL url = result.substr(nested_entities.back().entity_begin_pos); } else { i += 2; diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 15a519592..0168f4930 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -31,9 +31,9 @@ #include "td/telegram/MessageId.h" #include "td/telegram/MessageLinkInfo.h" #include "td/telegram/MessageReplyInfo.h" -#include "td/telegram/MessageThreadInfo.h" #include "td/telegram/MessagesDb.h" #include "td/telegram/MessageSearchFilter.h" +#include "td/telegram/MessageThreadInfo.h" #include "td/telegram/MessageTtlSetting.h" #include "td/telegram/net/NetQuery.h" #include "td/telegram/Notification.h" diff --git a/td/telegram/SponsoredMessages.cpp b/td/telegram/SponsoredMessages.cpp index 858524435..ddff5f652 100644 --- a/td/telegram/SponsoredMessages.cpp +++ b/td/telegram/SponsoredMessages.cpp @@ -6,6 +6,7 @@ // #include "td/telegram/SponsoredMessages.h" +#include "td/telegram/ChannelId.h" #include "td/telegram/ContactsManager.h" #include "td/telegram/Global.h" #include "td/telegram/MessageContent.h" @@ -13,8 +14,11 @@ #include "td/telegram/MessagesManager.h" #include "td/telegram/net/NetQueryCreator.h" #include "td/telegram/Td.h" +#include "td/telegram/telegram_api.h" -//#include "td/utils/buffer.h" +#include "td/utils/buffer.h" +#include "td/utils/logging.h" +#include "td/utils/Status.h" namespace td { diff --git a/td/telegram/ThemeManager.cpp b/td/telegram/ThemeManager.cpp index 61fa1b578..deb6dc941 100644 --- a/td/telegram/ThemeManager.cpp +++ b/td/telegram/ThemeManager.cpp @@ -13,6 +13,7 @@ #include "td/utils/algorithm.h" #include "td/utils/buffer.h" +#include "td/utils/logging.h" namespace td { @@ -159,7 +160,7 @@ ThemeManager::BaseTheme ThemeManager::get_base_theme( ThemeManager::ThemeSettings ThemeManager::get_chat_theme_settings( telegram_api::object_ptr settings) { ThemeSettings result; - if (settings != nullptr && 1 <= settings->message_colors_.size() && settings->message_colors_.size() <= 4) { + if (settings != nullptr && !settings->message_colors_.empty() && settings->message_colors_.size() <= 4) { auto background = td_->background_manager_->on_get_background(BackgroundId(), string(), std::move(settings->wallpaper_), false); diff --git a/td/telegram/ThemeManager.h b/td/telegram/ThemeManager.h index b7cd0e05e..3e2f13a39 100644 --- a/td/telegram/ThemeManager.h +++ b/td/telegram/ThemeManager.h @@ -8,7 +8,7 @@ #include "td/telegram/BackgroundId.h" #include "td/telegram/BackgroundType.h" -#include "td/telegram/td.h" +#include "td/telegram/td_api.h" #include "td/telegram/telegram_api.h" #include "td/actor/actor.h" diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp index 65fccb1c3..8a694b9aa 100644 --- a/td/telegram/WebPagesManager.cpp +++ b/td/telegram/WebPagesManager.cpp @@ -51,6 +51,8 @@ #include "td/utils/tl_helpers.h" #include "td/utils/utf8.h" +#include + namespace td { class GetWebPagePreviewQuery final : public Td::ResultHandler { diff --git a/test/country_info.cpp b/test/country_info.cpp index 3cbc08b7e..ca9f2376a 100644 --- a/test/country_info.cpp +++ b/test/country_info.cpp @@ -13,7 +13,6 @@ static void check_phone_number_info(const td::string &phone_number_prefix, const const td::string &calling_code, const td::string &formatted_phone_number) { auto result = td::CountryInfoManager::get_phone_number_info_sync(td::string(), phone_number_prefix); CHECK(result != nullptr); - // LOG(ERROR) << phone_number_prefix << ' ' << to_string(result); if (result->country_ == nullptr) { CHECK(country_code.empty()); } else {