Merge pull request #77 from naftali100/fix-limit-param

add missing limit params
This commit is contained in:
Andrea Cavalli 2022-10-30 19:11:33 +01:00 committed by GitHub
commit 0e6f6bc454
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9654,7 +9654,9 @@ td::Status Client::process_disable_proxy_query(PromisedQueryPtr &query) {
td::Status Client::process_get_chats_query(PromisedQueryPtr &query) {
CHECK_IS_USER();
send_request(make_object<td_api::getChats>(make_object<td_api::chatListMain>(), 100),
td::int32 limit = get_integer_arg(query.get(), "limit", 100, 0, 100);
send_request(make_object<td_api::getChats>(make_object<td_api::chatListMain>(), limit),
td::make_unique<TdOnGetChatsCallback>(this, std::move(query)));
return Status::OK();
}
@ -9663,8 +9665,9 @@ td::Status Client::process_get_common_chats_query(PromisedQueryPtr &query) {
CHECK_IS_USER();
TRY_RESULT(user_id, get_user_id(query.get()));
td::int64 offset_chat_id = get_integer_arg(query.get(), "offset_chat_id", 0);
td::int32 limit = get_integer_arg(query.get(), "limit", 100, 0, 100);
send_request(make_object<td_api::getGroupsInCommon>(user_id, offset_chat_id, 100),
send_request(make_object<td_api::getGroupsInCommon>(user_id, offset_chat_id, limit),
td::make_unique<TdOnGetChatsCallback>(this, std::move(query)));
return Status::OK();
}