Fix first chat loading.

GitOrigin-RevId: 606bbb51a4ef9f49bc94ed869c7a901a3b238f58
This commit is contained in:
levlam 2020-05-22 18:26:30 +03:00
parent a619ff4b87
commit 400959989b
2 changed files with 7 additions and 4 deletions

View File

@ -10906,7 +10906,10 @@ void MessagesManager::init() {
FolderId folder_id(r_folder_id.ok()); FolderId folder_id(r_folder_id.ok());
auto *folder = get_dialog_folder(folder_id); auto *folder = get_dialog_folder(folder_id);
CHECK(folder != nullptr); CHECK(folder != nullptr);
folder->last_database_server_dialog_date_ = DialogDate(r_order.ok(), DialogId(r_dialog_id.ok())); DialogDate dialog_date(r_order.ok(), DialogId(r_dialog_id.ok()));
if (folder->last_database_server_dialog_date_ < dialog_date) {
folder->last_database_server_dialog_date_ = dialog_date;
}
LOG(INFO) << "Loaded last_database_server_dialog_date_ " << folder->last_database_server_dialog_date_ << " in " LOG(INFO) << "Loaded last_database_server_dialog_date_ " << folder->last_database_server_dialog_date_ << " in "
<< folder_id; << folder_id;
} }

View File

@ -1278,9 +1278,9 @@ class MessagesManager : public Actor {
std::set<DialogDate> ordered_dialogs_; // all known dialogs, including with default order std::set<DialogDate> ordered_dialogs_; // all known dialogs, including with default order
// date of last known user/group/channel dialog in the right order // date of last known user/group/channel dialog in the right order
DialogDate last_server_dialog_date_ = MIN_DIALOG_DATE; DialogDate last_server_dialog_date_{MAX_ORDINARY_DIALOG_ORDER, DialogId()};
DialogDate last_loaded_database_dialog_date_ = MIN_DIALOG_DATE; DialogDate last_loaded_database_dialog_date_{MAX_ORDINARY_DIALOG_ORDER, DialogId()};
DialogDate last_database_server_dialog_date_ = MIN_DIALOG_DATE; DialogDate last_database_server_dialog_date_{MAX_ORDINARY_DIALOG_ORDER, DialogId()};
MultiPromiseActor load_folder_dialog_list_multipromise_{ MultiPromiseActor load_folder_dialog_list_multipromise_{
"LoadDialogListMultiPromiseActor"}; // must be defined before pending_on_get_dialogs_ "LoadDialogListMultiPromiseActor"}; // must be defined before pending_on_get_dialogs_