diff --git a/td/telegram/Global.cpp b/td/telegram/Global.cpp index d5417e88..c3421dae 100644 --- a/td/telegram/Global.cpp +++ b/td/telegram/Global.cpp @@ -102,6 +102,9 @@ Status Global::init(const TdParameters ¶meters, ActorId td, unique_ptr system_time) { double time_backwards_fix = saved_diff.system_time - system_time; @@ -129,8 +132,9 @@ Status Global::init(const TdParameters ¶meters, ActorId td, unique_ptr(server_time); } diff --git a/td/telegram/Global.h b/td/telegram/Global.h index 9cfc0f3e..6fbf7223 100644 --- a/td/telegram/Global.h +++ b/td/telegram/Global.h @@ -398,6 +398,8 @@ class Global : public ActorContext { std::atomic dns_time_difference_was_updated_{false}; std::atomic close_flag_{false}; std::atomic system_time_saved_at_{-1e10}; + double saved_diff_ = 0.0; + double saved_system_time_ = 0.0; #if !TD_HAVE_ATOMIC_SHARED_PTR std::mutex dh_config_mutex_; @@ -418,7 +420,7 @@ class Global : public ActorContext { std::unordered_map location_access_hashes_; - static int32 to_unix_time(double server_time); + int32 to_unix_time(double server_time) const; void do_save_server_time_difference();