From c65af3ac6ea00f88064350204790082bfe4028d8 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 31 Aug 2022 11:11:37 +0300 Subject: [PATCH] Improve field name. --- td/telegram/LanguagePackManager.cpp | 1 - td/telegram/MessagesManager.cpp | 6 +++--- td/telegram/MessagesManager.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/td/telegram/LanguagePackManager.cpp b/td/telegram/LanguagePackManager.cpp index 19122457d..cef868df9 100644 --- a/td/telegram/LanguagePackManager.cpp +++ b/td/telegram/LanguagePackManager.cpp @@ -7,7 +7,6 @@ #include "td/telegram/LanguagePackManager.h" #include "td/telegram/Global.h" -#include "td/telegram/logevent/LogEvent.h" #include "td/telegram/misc.h" #include "td/telegram/net/NetQueryDispatcher.h" #include "td/telegram/Td.h" diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 7966a0850..d3cb5b91b 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -17793,7 +17793,7 @@ std::pair> MessagesManager::get_common_dialogs(UserId us if (it != found_common_dialogs_.end() && !it->second.dialog_ids.empty()) { int32 total_count = it->second.total_count; vector &common_dialog_ids = it->second.dialog_ids; - bool use_cache = (!it->second.is_outdated && it->second.received_date >= Time::now() - 3600) || force || + bool use_cache = (!it->second.is_outdated && it->second.receive_time >= Time::now() - 3600) || force || offset_chat_id != 0 || common_dialog_ids.size() >= static_cast(MAX_GET_DIALOGS); // use cache if it is up-to-date, or we required to use it or we can't update it if (use_cache) { @@ -17841,8 +17841,8 @@ void MessagesManager::on_get_common_dialogs(UserId user_id, int64 offset_chat_id // drop outdated cache if possible common_dialogs = CommonDialogs(); } - if (common_dialogs.received_date == 0) { - common_dialogs.received_date = Time::now(); + if (common_dialogs.receive_time == 0) { + common_dialogs.receive_time = Time::now(); } common_dialogs.is_outdated = false; auto &result = common_dialogs.dialog_ids; diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 92a04675c..f0f74aaa0 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -3512,7 +3512,7 @@ class MessagesManager final : public Actor { struct CommonDialogs { vector dialog_ids; - double received_date = 0; + double receive_time = 0; int32 total_count = 0; bool is_outdated = false; };