diff --git a/td/telegram/StateManager.cpp b/td/telegram/StateManager.cpp index 7a1c1cc97..69901cc34 100644 --- a/td/telegram/StateManager.cpp +++ b/td/telegram/StateManager.cpp @@ -68,6 +68,7 @@ void StateManager::add_callback(unique_ptr callback) { callbacks_.push_back(std::move(callback)); } } + void StateManager::wait_first_sync(Promise<> promise) { if (was_sync_) { return promise.set_value(Unit()); diff --git a/td/telegram/net/Session.cpp b/td/telegram/net/Session.cpp index 4610159fa..d594bba83 100644 --- a/td/telegram/net/Session.cpp +++ b/td/telegram/net/Session.cpp @@ -333,12 +333,14 @@ void Session::on_network(bool network_flag, uint32 network_generation) { } void Session::on_online(bool online_flag) { + LOG(DEBUG) << "Set online flag to " << online_flag; online_flag_ = online_flag; connection_online_update(true); loop(); } void Session::on_logging_out(bool logging_out_flag) { + LOG(DEBUG) << "Set logging out flag to " << logging_out_flag; logging_out_flag_ = logging_out_flag; connection_online_update(true); loop(); diff --git a/td/telegram/net/Session.h b/td/telegram/net/Session.h index 6dba9fcfd..3eb61fee4 100644 --- a/td/telegram/net/Session.h +++ b/td/telegram/net/Session.h @@ -104,17 +104,17 @@ class Session final // Just re-ask answer_id each time we get information about it. // Though mtproto::Connection must ensure delivery of such query. - int32 raw_dc_id_; // numerical datacenter ID, i.e. 2 - int32 dc_id_; // unique datacenter ID, i.e. -10002 - enum class Mode : int8 { Tcp, Http } mode_ = Mode::Tcp; - bool is_main_; // true only for the primary Session(s) to the main DC - bool is_cdn_; - bool need_destroy_; + const int32 raw_dc_id_; // numerical datacenter ID, i.e. 2 + const int32 dc_id_; // unique datacenter ID, i.e. -10002 + const bool is_main_; // true only for the primary Session(s) to the main DC + const bool is_cdn_; + const bool need_destroy_; bool was_on_network_ = false; bool network_flag_ = false; bool online_flag_ = false; bool logging_out_flag_ = false; bool connection_online_flag_ = false; + enum class Mode : int8 { Tcp, Http } mode_ = Mode::Tcp; uint32 network_generation_ = 0; uint64 being_binded_tmp_auth_key_id_ = 0; uint64 being_checked_main_auth_key_id_ = 0;