Merge remote-tracking branch 'td/master'

This commit is contained in:
Andrea Cavalli 2021-10-05 12:29:46 +02:00
commit e5a7f26b7b
2 changed files with 15 additions and 7 deletions

View File

@ -106,7 +106,13 @@ 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) {
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 {
@ -114,6 +120,7 @@ void RecentDialogList::load_dialogs(Promise<Unit> &&promise) {
}));
td_->contacts_manager_->search_contacts("", 1, mpas.get_promise());
}
}
lock.set_value(Unit());
}

View File

@ -112,6 +112,7 @@ TDJSON_EXPORT void td_json_client_destroy(void *client);
* Also note that all updates and responses to requests must be applied in the order they were received for consistency.
* Some TDLib requests can be executed synchronously from any thread using td_execute.
* TDLib client instances are destroyed automatically after they are closed.
* All TDLib client instances must be closed before application termination to ensure data consistency.
*
* General pattern of usage:
* \code