Fix recent dialog list loading.

This commit is contained in:
levlam 2021-10-05 10:44:13 +03:00
parent 48025d969c
commit bcfc2a7dc1

View File

@ -106,13 +106,20 @@ void RecentDialogList::load_dialogs(Promise<Unit> &&promise) {
dialog_ids.push_back(DialogId(to_integer<int64>(found_dialog)));
}
}
if (!dialog_ids.empty() && !G()->parameters().use_chat_info_db) {
td_->messages_manager_->get_dialogs_from_list(
DialogListId(FolderId::main()), 102,
PromiseCreator::lambda([promise = mpas.get_promise()](td_api::object_ptr<td_api::chats> &&chats) mutable {
promise.set_value(Unit());
}));
td_->contacts_manager_->search_contacts("", 1, mpas.get_promise());
if (!dialog_ids.empty()) {
if (G()->parameters().use_chat_info_db) {
td_->messages_manager_->load_dialogs(
std::move(dialog_ids),
PromiseCreator::lambda(
[promise = mpas.get_promise()](vector<DialogId> dialog_ids) mutable { promise.set_value(Unit()); }));
} else {
td_->messages_manager_->get_dialogs_from_list(
DialogListId(FolderId::main()), 102,
PromiseCreator::lambda([promise = mpas.get_promise()](td_api::object_ptr<td_api::chats> &&chats) mutable {
promise.set_value(Unit());
}));
td_->contacts_manager_->search_contacts("", 1, mpas.get_promise());
}
}
lock.set_value(Unit());