diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index cad89eefb..b6985a8fc 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -7522,6 +7522,9 @@ getSuitableDiscussionChats = Chats; //@description Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of joined supergroups and channels and receives CHANNELS_TOO_MUCH error. Also, the limit can be increased with Telegram Premium getInactiveSupergroupChats = Chats; +//@description Returns a list of channel chats, which can be used as a personal chat +getSuitablePersonalChats = Chats; + //@description Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error if all topics have been loaded //@limit The maximum number of topics to be loaded. For optimal performance, the number of loaded topics is chosen by TDLib and can be smaller than the specified limit, even if the end of the list is not reached diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 74d05e44c..af450eafd 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -5234,6 +5234,12 @@ void Td::on_request(uint64 id, const td_api::getInactiveSupergroupChats &request CREATE_NO_ARGS_REQUEST(GetInactiveSupergroupChatsRequest); } +void Td::on_request(uint64 id, const td_api::getSuitablePersonalChats &request) { + CHECK_IS_USER(); + CREATE_REQUEST_PROMISE(); + contacts_manager_->get_created_public_dialogs(PublicDialogType::ForPersonalDialog, std::move(promise), false); +} + void Td::on_request(uint64 id, td_api::searchRecentlyFoundChats &request) { CHECK_IS_USER(); CLEAN_INPUT_STRING(request.query_); diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 4173eb206..789fc578f 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -742,6 +742,8 @@ class Td final : public Actor { void on_request(uint64 id, const td_api::getInactiveSupergroupChats &request); + void on_request(uint64 id, const td_api::getSuitablePersonalChats &request); + void on_request(uint64 id, const td_api::openChat &request); void on_request(uint64 id, const td_api::closeChat &request); diff --git a/td/telegram/cli.cpp b/td/telegram/cli.cpp index 0c5de6ae6..95621f4bc 100644 --- a/td/telegram/cli.cpp +++ b/td/telegram/cli.cpp @@ -5446,6 +5446,8 @@ class CliClient final : public Actor { send_request(td_api::make_object()); } else if (op == "gisc") { send_request(td_api::make_object()); + } else if (op == "gspc") { + send_request(td_api::make_object()); } else if (op == "cpc") { UserId user_id; bool force;