Improve field name.

This commit is contained in:
levlam 2022-08-31 11:11:37 +03:00
parent 8c9911c7c6
commit c65af3ac6e
3 changed files with 4 additions and 5 deletions

View File

@ -7,7 +7,6 @@
#include "td/telegram/LanguagePackManager.h" #include "td/telegram/LanguagePackManager.h"
#include "td/telegram/Global.h" #include "td/telegram/Global.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/misc.h" #include "td/telegram/misc.h"
#include "td/telegram/net/NetQueryDispatcher.h" #include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/Td.h" #include "td/telegram/Td.h"

View File

@ -17793,7 +17793,7 @@ std::pair<int32, vector<DialogId>> MessagesManager::get_common_dialogs(UserId us
if (it != found_common_dialogs_.end() && !it->second.dialog_ids.empty()) { if (it != found_common_dialogs_.end() && !it->second.dialog_ids.empty()) {
int32 total_count = it->second.total_count; int32 total_count = it->second.total_count;
vector<DialogId> &common_dialog_ids = it->second.dialog_ids; vector<DialogId> &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<size_t>(MAX_GET_DIALOGS); offset_chat_id != 0 || common_dialog_ids.size() >= static_cast<size_t>(MAX_GET_DIALOGS);
// use cache if it is up-to-date, or we required to use it or we can't update it // use cache if it is up-to-date, or we required to use it or we can't update it
if (use_cache) { 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 // drop outdated cache if possible
common_dialogs = CommonDialogs(); common_dialogs = CommonDialogs();
} }
if (common_dialogs.received_date == 0) { if (common_dialogs.receive_time == 0) {
common_dialogs.received_date = Time::now(); common_dialogs.receive_time = Time::now();
} }
common_dialogs.is_outdated = false; common_dialogs.is_outdated = false;
auto &result = common_dialogs.dialog_ids; auto &result = common_dialogs.dialog_ids;

View File

@ -3512,7 +3512,7 @@ class MessagesManager final : public Actor {
struct CommonDialogs { struct CommonDialogs {
vector<DialogId> dialog_ids; vector<DialogId> dialog_ids;
double received_date = 0; double receive_time = 0;
int32 total_count = 0; int32 total_count = 0;
bool is_outdated = false; bool is_outdated = false;
}; };