diff --git a/SplitSource.php b/SplitSource.php
index c6d9dde0..e4458245 100644
--- a/SplitSource.php
+++ b/SplitSource.php
@@ -16,7 +16,7 @@ function disjoint_set_union(&$parents, $x, $y) {
$parents[$x] = $y;
} else {
$parents[$y] = $x;
- }
+ }
}
}
@@ -107,7 +107,7 @@ function split_file($file, $chunks, $undo) {
$common .= $line;
continue;
}
-
+
if (strpos($line, 'static ') === 0 && $depth === $target_depth) {
$is_static = true;
}
diff --git a/td/telegram/AudiosManager.cpp b/td/telegram/AudiosManager.cpp
index d84ed5d4..836eae8c 100644
--- a/td/telegram/AudiosManager.cpp
+++ b/td/telegram/AudiosManager.cpp
@@ -6,7 +6,6 @@
//
#include "td/telegram/AudiosManager.h"
-#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/Td.h"
diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp
index bcb9f444..83b87f01 100644
--- a/td/telegram/ConfigManager.cpp
+++ b/td/telegram/ConfigManager.cpp
@@ -17,6 +17,7 @@
#include "td/telegram/net/NetType.h"
#include "td/telegram/net/PublicRsaKeyShared.h"
#include "td/telegram/net/Session.h"
+#include "td/telegram/StateManager.h"
#if !TD_EMSCRIPTEN //FIXME
#include "td/net/HttpQuery.h"
diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h
index 0b2e4e62..0548839f 100644
--- a/td/telegram/ConfigManager.h
+++ b/td/telegram/ConfigManager.h
@@ -70,4 +70,5 @@ class ConfigManager : public NetQueryCallback {
void save_dc_options_update(DcOptions dc_options);
DcOptions load_dc_options_update();
};
+
} // namespace td
diff --git a/td/telegram/Game.hpp b/td/telegram/Game.hpp
index a0c5c8ec..1bcc3066 100644
--- a/td/telegram/Game.hpp
+++ b/td/telegram/Game.hpp
@@ -11,6 +11,7 @@
#include "td/telegram/AnimationsManager.hpp"
#include "td/telegram/MessageEntity.hpp"
#include "td/telegram/Photo.hpp"
+#include "td/telegram/Td.h"
#include "td/telegram/Version.h"
#include "td/utils/tl_helpers.h"
diff --git a/td/telegram/Global.cpp b/td/telegram/Global.cpp
index 9687ad2e..47f035b2 100644
--- a/td/telegram/Global.cpp
+++ b/td/telegram/Global.cpp
@@ -11,6 +11,7 @@
#include "td/telegram/net/MtprotoHeader.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/net/TempAuthKeyWatchdog.h"
+#include "td/telegram/StateManager.h"
#include "td/telegram/TdDb.h"
#include "td/actor/PromiseFuture.h"
diff --git a/td/telegram/Global.h b/td/telegram/Global.h
index f6588fc6..834082fe 100644
--- a/td/telegram/Global.h
+++ b/td/telegram/Global.h
@@ -33,14 +33,14 @@
namespace td {
class AnimationsManager;
class CallManager;
-class ConfigShared;
class ConfigManager;
+class ConfigShared;
class ConnectionCreator;
class ContactsManager;
class FileManager;
class LanguagePackManager;
-class MtprotoHeader;
class MessagesManager;
+class MtprotoHeader;
class NetQueryDispatcher;
class PasswordManager;
class SecretChatsManager;
@@ -139,84 +139,20 @@ class Global : public ActorContext {
ActorId
td() const {
return td_;
}
+
ActorId animations_manager() const {
return animations_manager_;
}
void set_animations_manager(ActorId animations_manager) {
animations_manager_ = animations_manager;
}
- ActorId contacts_manager() const {
- return contacts_manager_;
- }
- void set_contacts_manager(ActorId contacts_manager) {
- contacts_manager_ = contacts_manager;
- }
- ActorId file_manager() const {
- return file_manager_;
- }
- void set_file_manager(ActorId file_manager) {
- file_manager_ = std::move(file_manager);
- }
- ActorId language_pack_manager() const {
- return language_pack_manager_;
- }
- void set_language_pack_manager(ActorId language_pack_manager) {
- language_pack_manager_ = language_pack_manager;
- }
- ActorId messages_manager() const {
- return messages_manager_;
- }
- void set_messages_manager(ActorId messages_manager) {
- messages_manager_ = messages_manager;
- }
- ActorId password_manager() const {
- return password_manager_;
- }
- void set_password_manager(ActorId password_manager) {
- password_manager_ = password_manager;
- }
- ActorId secret_chats_manager() const {
- return secret_chats_manager_;
- }
- void set_secret_chats_manager(ActorId secret_chats_manager) {
- secret_chats_manager_ = secret_chats_manager;
- }
+
ActorId call_manager() const {
return call_manager_;
}
void set_call_manager(ActorId call_manager) {
call_manager_ = call_manager;
}
- ActorId stickers_manager() const {
- return stickers_manager_;
- }
- void set_stickers_manager(ActorId stickers_manager) {
- stickers_manager_ = stickers_manager;
- }
- ActorId storage_manager() const {
- return storage_manager_;
- }
- void set_storage_manager(ActorId storage_manager) {
- storage_manager_ = storage_manager;
- }
- ActorId top_dialog_manager() const {
- return top_dialog_manager_;
- }
- void set_top_dialog_manager(ActorId top_dialog_manager) {
- top_dialog_manager_ = top_dialog_manager;
- }
- ActorId updates_manager() const {
- return updates_manager_;
- }
- void set_updates_manager(ActorId updates_manager) {
- updates_manager_ = updates_manager;
- }
- ActorId web_pages_manager() const {
- return web_pages_manager_;
- }
- void set_web_pages_manager(ActorId web_pages_manager) {
- web_pages_manager_ = web_pages_manager;
- }
ActorId config_manager() const {
return config_manager_;
@@ -225,6 +161,83 @@ class Global : public ActorContext {
config_manager_ = config_manager;
}
+ ActorId contacts_manager() const {
+ return contacts_manager_;
+ }
+ void set_contacts_manager(ActorId contacts_manager) {
+ contacts_manager_ = contacts_manager;
+ }
+
+ ActorId file_manager() const {
+ return file_manager_;
+ }
+ void set_file_manager(ActorId file_manager) {
+ file_manager_ = std::move(file_manager);
+ }
+
+ ActorId language_pack_manager() const {
+ return language_pack_manager_;
+ }
+ void set_language_pack_manager(ActorId language_pack_manager) {
+ language_pack_manager_ = language_pack_manager;
+ }
+
+ ActorId messages_manager() const {
+ return messages_manager_;
+ }
+ void set_messages_manager(ActorId messages_manager) {
+ messages_manager_ = messages_manager;
+ }
+
+ ActorId password_manager() const {
+ return password_manager_;
+ }
+ void set_password_manager(ActorId password_manager) {
+ password_manager_ = password_manager;
+ }
+
+ ActorId secret_chats_manager() const {
+ return secret_chats_manager_;
+ }
+ void set_secret_chats_manager(ActorId secret_chats_manager) {
+ secret_chats_manager_ = secret_chats_manager;
+ }
+
+ ActorId stickers_manager() const {
+ return stickers_manager_;
+ }
+ void set_stickers_manager(ActorId stickers_manager) {
+ stickers_manager_ = stickers_manager;
+ }
+
+ ActorId storage_manager() const {
+ return storage_manager_;
+ }
+ void set_storage_manager(ActorId storage_manager) {
+ storage_manager_ = storage_manager;
+ }
+
+ ActorId top_dialog_manager() const {
+ return top_dialog_manager_;
+ }
+ void set_top_dialog_manager(ActorId top_dialog_manager) {
+ top_dialog_manager_ = top_dialog_manager;
+ }
+
+ ActorId updates_manager() const {
+ return updates_manager_;
+ }
+ void set_updates_manager(ActorId updates_manager) {
+ updates_manager_ = updates_manager;
+ }
+
+ ActorId web_pages_manager() const {
+ return web_pages_manager_;
+ }
+ void set_web_pages_manager(ActorId web_pages_manager) {
+ web_pages_manager_ = web_pages_manager;
+ }
+
ActorId connection_creator() const;
void set_connection_creator(ActorOwn connection_creator);
@@ -314,19 +327,19 @@ class Global : public ActorContext {
ActorId td_;
ActorId animations_manager_;
+ ActorId call_manager_;
+ ActorId config_manager_;
ActorId contacts_manager_;
ActorId file_manager_;
- ActorId messages_manager_;
ActorId language_pack_manager_;
+ ActorId messages_manager_;
ActorId password_manager_;
ActorId secret_chats_manager_;
- ActorId call_manager_;
ActorId stickers_manager_;
ActorId storage_manager_;
ActorId top_dialog_manager_;
ActorId updates_manager_;
ActorId web_pages_manager_;
- ActorId config_manager_;
ActorOwn connection_creator_;
ActorOwn temp_auth_key_watchdog_;
diff --git a/td/telegram/InlineQueriesManager.cpp b/td/telegram/InlineQueriesManager.cpp
index 3398c918..f4838149 100644
--- a/td/telegram/InlineQueriesManager.cpp
+++ b/td/telegram/InlineQueriesManager.cpp
@@ -31,10 +31,8 @@
#include "td/telegram/ReplyMarkup.h"
#include "td/telegram/StickersManager.h"
#include "td/telegram/Td.h"
-#include "td/telegram/VideoNotesManager.h"
#include "td/telegram/VideosManager.h"
#include "td/telegram/VoiceNotesManager.h"
-#include "td/telegram/WebPagesManager.h"
#include "td/telegram/net/DcId.h"
diff --git a/td/telegram/LanguagePackManager.cpp b/td/telegram/LanguagePackManager.cpp
index 4f7429ec..9854e05b 100644
--- a/td/telegram/LanguagePackManager.cpp
+++ b/td/telegram/LanguagePackManager.cpp
@@ -10,6 +10,7 @@
#include "td/telegram/Global.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/misc.h"
+#include "td/telegram/net/DcId.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/Td.h"
diff --git a/td/telegram/Log.cpp b/td/telegram/Log.cpp
index 26bcd31f..5fa71118 100644
--- a/td/telegram/Log.cpp
+++ b/td/telegram/Log.cpp
@@ -8,6 +8,8 @@
#include "td/telegram/Logging.h"
+#include "td/telegram/td_api.h"
+
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"
diff --git a/td/telegram/Logging.cpp b/td/telegram/Logging.cpp
index e742418f..94b27289 100644
--- a/td/telegram/Logging.cpp
+++ b/td/telegram/Logging.cpp
@@ -6,8 +6,8 @@
//
#include "td/telegram/Logging.h"
-#include "td/telegram/net/ConnectionCreator.h"
#include "td/telegram/files/FileManager.h"
+#include "td/telegram/net/ConnectionCreator.h"
#include "td/telegram/Td.h"
#include "tddb/td/db/binlog/BinlogEvent.h"
diff --git a/td/telegram/PtsManager.h b/td/telegram/PtsManager.h
index c7c50409..a4656677 100644
--- a/td/telegram/PtsManager.h
+++ b/td/telegram/PtsManager.h
@@ -10,6 +10,7 @@
#include "td/utils/logging.h"
namespace td {
+
// It is not about handling gaps.
// It is about finding mem processed pts.
// All checks must be done before.
@@ -54,4 +55,5 @@ class PtsManager {
int32 mem_pts_ = -1;
ChangesProcessor state_helper_;
};
+
} // namespace td
diff --git a/td/telegram/RequestActor.h b/td/telegram/RequestActor.h
index d4b577f4..be0c575e 100644
--- a/td/telegram/RequestActor.h
+++ b/td/telegram/RequestActor.h
@@ -9,6 +9,11 @@
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
+#include "td/telegram/AuthManager.h"
+#include "td/telegram/Td.h"
+
+#include "td/telegram/td_api.h"
+
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Status.h"
@@ -17,8 +22,6 @@
namespace td {
-class Td;
-
template
class RequestActor : public Actor {
public:
diff --git a/td/telegram/SecretChatActor.h b/td/telegram/SecretChatActor.h
index 08c8dc1c..4dc6684e 100644
--- a/td/telegram/SecretChatActor.h
+++ b/td/telegram/SecretChatActor.h
@@ -19,7 +19,6 @@
#include "td/telegram/DhConfig.h"
#include "td/telegram/logevent/SecretChatEvent.h"
#include "td/telegram/MessageId.h"
-#include "td/telegram/PtsManager.h"
#include "td/telegram/SecretChatDb.h"
#include "td/telegram/SecretChatId.h"
#include "td/telegram/UserId.h"
diff --git a/td/telegram/SecretChatsManager.cpp b/td/telegram/SecretChatsManager.cpp
index 8467c154..4da7ff5d 100644
--- a/td/telegram/SecretChatsManager.cpp
+++ b/td/telegram/SecretChatsManager.cpp
@@ -16,6 +16,7 @@
#include "td/telegram/MessagesManager.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/SequenceDispatcher.h"
+#include "td/telegram/StateManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/secret_api.h"
diff --git a/td/telegram/VideoNotesManager.cpp b/td/telegram/VideoNotesManager.cpp
index 4611452d..fff544a2 100644
--- a/td/telegram/VideoNotesManager.cpp
+++ b/td/telegram/VideoNotesManager.cpp
@@ -10,7 +10,6 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
-#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/Td.h"
diff --git a/td/telegram/VideosManager.cpp b/td/telegram/VideosManager.cpp
index 1331c829..3944b34e 100644
--- a/td/telegram/VideosManager.cpp
+++ b/td/telegram/VideosManager.cpp
@@ -11,7 +11,6 @@
#include "td/telegram/telegram_api.h"
#include "td/telegram/AuthManager.h"
-#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/Td.h"
diff --git a/td/telegram/VoiceNotesManager.cpp b/td/telegram/VoiceNotesManager.cpp
index 326cd563..bb72bbf2 100644
--- a/td/telegram/VoiceNotesManager.cpp
+++ b/td/telegram/VoiceNotesManager.cpp
@@ -10,7 +10,6 @@
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
-#include "td/telegram/DocumentsManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/Td.h"
diff --git a/td/telegram/WebPagesManager.cpp b/td/telegram/WebPagesManager.cpp
index 83b95528..19dc8c56 100644
--- a/td/telegram/WebPagesManager.cpp
+++ b/td/telegram/WebPagesManager.cpp
@@ -42,8 +42,10 @@
#include "td/db/SqliteKeyValueAsync.h"
#include "td/utils/buffer.h"
+#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
+#include "td/utils/Slice.h"
#include "td/utils/StringBuilder.h"
#include "td/utils/tl_helpers.h"
diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp
index abb75867..e56b819a 100644
--- a/td/telegram/cli.cpp
+++ b/td/telegram/cli.cpp
@@ -416,7 +416,7 @@ class CliClient final : public Actor {
break;
case td_api::authorizationStateClosed::ID:
LOG(WARNING) << "TD closed";
- td_.reset();
+ td_client_.reset();
if (!close_flag_) {
create_td("ClientActor3");
}
@@ -676,7 +676,7 @@ class CliClient final : public Actor {
LOG(WARNING) << "QUIT";
close_flag_ = true;
dump_memory_usage();
- td_.reset();
+ td_client_.reset();
Scheduler::unsubscribe(stdin_.get_poll_info().get_pollable_fd_ref());
is_stdin_reader_stopped_ = true;
yield();
@@ -737,7 +737,7 @@ class CliClient final : public Actor {
uint64 generation_;
};
- td_ = create_actor(name, make_unique(this, ++generation_));
+ td_client_ = create_actor(name, make_unique(this, ++generation_));
}
void init_td() {
@@ -753,7 +753,7 @@ class CliClient final : public Actor {
create_td("ClientActor2");
for (int i = 0; i < 4; i++) {
- send_closure_later(td_, &ClientActor::request, std::numeric_limits::max(),
+ send_closure_later(td_client_, &ClientActor::request, std::numeric_limits::max(),
td_api::make_object(0.001 + 1000 * (i / 2)));
}
@@ -1142,9 +1142,9 @@ class CliClient final : public Actor {
uint64 send_request(tl_object_ptr f) {
static uint64 query_num = 1;
- if (!td_.empty()) {
+ if (!td_client_.empty()) {
auto id = query_num++;
- send_closure_later(td_, &ClientActor::request, id, std::move(f));
+ send_closure_later(td_client_, &ClientActor::request, id, std::move(f));
return id;
} else {
LOG(ERROR) << "Failed to send: " << to_string(f);
@@ -3536,7 +3536,7 @@ class CliClient final : public Actor {
ConcurrentScheduler *scheduler_{nullptr};
bool use_test_dc_ = false;
- ActorOwn td_;
+ ActorOwn td_client_;
std::queue cmd_queue_;
bool close_flag_ = false;
bool ready_to_stop_ = false;
diff --git a/td/telegram/files/FileLoader.cpp b/td/telegram/files/FileLoader.cpp
index 0ca525eb..666490eb 100644
--- a/td/telegram/files/FileLoader.cpp
+++ b/td/telegram/files/FileLoader.cpp
@@ -9,7 +9,6 @@
#include "td/telegram/files/ResourceManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/net/NetQueryDispatcher.h"
-#include "td/telegram/Td.h"
#include "td/telegram/UniqueId.h"
#include "td/utils/format.h"
diff --git a/td/telegram/files/FileManager.cpp b/td/telegram/files/FileManager.cpp
index a7a1504e..fd49ba7e 100644
--- a/td/telegram/files/FileManager.cpp
+++ b/td/telegram/files/FileManager.cpp
@@ -13,7 +13,6 @@
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/Global.h"
#include "td/telegram/misc.h"
-#include "td/telegram/Td.h"
#include "td/utils/base64.h"
#include "td/utils/format.h"
diff --git a/td/telegram/net/DcAuthManager.h b/td/telegram/net/DcAuthManager.h
index 71c13914..58ff3927 100644
--- a/td/telegram/net/DcAuthManager.h
+++ b/td/telegram/net/DcAuthManager.h
@@ -19,6 +19,7 @@
#include
namespace td {
+
class DcAuthManager : public NetQueryCallback {
public:
explicit DcAuthManager(ActorShared<> parent);
@@ -56,4 +57,5 @@ class DcAuthManager : public NetQueryCallback {
void loop() override;
};
+
} // namespace td
diff --git a/tdactor/test/actors_simple.cpp b/tdactor/test/actors_simple.cpp
index afe5b0fd..a43ff378 100644
--- a/tdactor/test/actors_simple.cpp
+++ b/tdactor/test/actors_simple.cpp
@@ -15,6 +15,7 @@
#include "td/utils/logging.h"
#include "td/utils/MpscPollableQueue.h"
#include "td/utils/Observer.h"
+#include "td/utils/port/detail/PollableFd.h"
#include "td/utils/port/FileFd.h"
#include "td/utils/port/thread.h"
#include "td/utils/Slice.h"
diff --git a/tdutils/td/utils/Variant.h b/tdutils/td/utils/Variant.h
index d7bbe1ef..4a3efbcb 100644
--- a/tdutils/td/utils/Variant.h
+++ b/tdutils/td/utils/Variant.h
@@ -172,7 +172,7 @@ class Variant {
void init_empty(T &&t) {
CHECK(offset_ == npos) << offset_
#if TD_CLANG || TD_GCC
- << __PRETTY_FUNCTION__
+ << ' ' << __PRETTY_FUNCTION__
#endif
;
offset_ = offset();
diff --git a/tdutils/td/utils/port/FileFd.cpp b/tdutils/td/utils/port/FileFd.cpp
index 0448d153..2ca7c6c9 100644
--- a/tdutils/td/utils/port/FileFd.cpp
+++ b/tdutils/td/utils/port/FileFd.cpp
@@ -16,6 +16,7 @@
#include "td/utils/port/detail/PollableFd.h"
#include "td/utils/port/PollFlags.h"
#include "td/utils/port/sleep.h"
+#include "td/utils/ScopeGuard.h"
#include "td/utils/StringBuilder.h"
#include
diff --git a/test/tdclient.cpp b/test/tdclient.cpp
index 7c2d8a35..edd7eed4 100644
--- a/test/tdclient.cpp
+++ b/test/tdclient.cpp
@@ -67,7 +67,7 @@ class TestClient : public Actor {
};
void close(Promise<> close_promise) {
close_promise_ = std::move(close_promise);
- td_.reset();
+ td_client_.reset();
}
unique_ptr make_td_callback() {
@@ -142,10 +142,10 @@ class TestClient : public Actor {
set_tag(name_);
LOG(INFO) << "START UP!";
- td_ = create_actor("Td-proxy", make_td_callback());
+ td_client_ = create_actor("Td-proxy", make_td_callback());
}
- ActorOwn td_;
+ ActorOwn td_client_;
string name_;
@@ -177,7 +177,7 @@ class Task : public TestClient::Listener {
void send_query(tl_object_ptr function, F callback) {
auto id = current_query_id_++;
sent_queries_[id] = std::forward(callback);
- send_closure(client_->td_, &ClientActor::request, id, std::move(function));
+ send_closure(client_->td_client_, &ClientActor::request, id, std::move(function));
}
protected:
| |