Use invokeAfter for self-edit queries.

This commit is contained in:
levlam 2022-08-22 22:12:00 +03:00
parent c0f1a9850d
commit d1cc119b9d
3 changed files with 19 additions and 13 deletions

View File

@ -118,7 +118,7 @@ class SetAccountTtlQuery final : public Td::ResultHandler {
void send(int32 account_ttl) {
send_query(G()->net_query_creator().create(
telegram_api::account_setAccountTTL(make_tl_object<telegram_api::accountDaysTTL>(account_ttl))));
telegram_api::account_setAccountTTL(make_tl_object<telegram_api::accountDaysTTL>(account_ttl)), {{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -315,7 +315,8 @@ class ChangeAuthorizationSettingsQuery final : public Td::ResultHandler {
flags |= telegram_api::account_changeAuthorizationSettings::CALL_REQUESTS_DISABLED_MASK;
}
send_query(G()->net_query_creator().create(telegram_api::account_changeAuthorizationSettings(
flags, hash, encrypted_requests_disabled, call_requests_disabled)));
flags, hash, encrypted_requests_disabled, call_requests_disabled),
{{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -342,7 +343,8 @@ class SetAuthorizationTtlQuery final : public Td::ResultHandler {
}
void send(int32 authorization_ttl_days) {
send_query(G()->net_query_creator().create(telegram_api::account_setAuthorizationTTL(authorization_ttl_days)));
send_query(
G()->net_query_creator().create(telegram_api::account_setAuthorizationTTL(authorization_ttl_days), {{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -472,7 +474,7 @@ class SetBotGroupDefaultAdminRightsQuery final : public Td::ResultHandler {
void send(AdministratorRights administrator_rights) {
send_query(G()->net_query_creator().create(
telegram_api::bots_setBotGroupDefaultAdminRights(administrator_rights.get_chat_admin_rights())));
telegram_api::bots_setBotGroupDefaultAdminRights(administrator_rights.get_chat_admin_rights()), {{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -505,7 +507,7 @@ class SetBotBroadcastDefaultAdminRightsQuery final : public Td::ResultHandler {
void send(AdministratorRights administrator_rights) {
send_query(G()->net_query_creator().create(
telegram_api::bots_setBotBroadcastDefaultAdminRights(administrator_rights.get_chat_admin_rights())));
telegram_api::bots_setBotBroadcastDefaultAdminRights(administrator_rights.get_chat_admin_rights()), {{"me"}}));
}
void on_result(BufferSlice packet) final {

View File

@ -462,8 +462,10 @@ class UploadProfilePhotoQuery final : public Td::ResultHandler {
flags |= telegram_api::photos_uploadProfilePhoto::FILE_MASK;
photo_input_file = std::move(input_file);
}
send_query(G()->net_query_creator().create(telegram_api::photos_uploadProfilePhoto(
flags, std::move(photo_input_file), std::move(video_input_file), main_frame_timestamp)));
send_query(G()->net_query_creator().create(
telegram_api::photos_uploadProfilePhoto(flags, std::move(photo_input_file), std::move(video_input_file),
main_frame_timestamp),
{{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -501,7 +503,8 @@ class UpdateProfilePhotoQuery final : public Td::ResultHandler {
file_id_ = file_id;
old_photo_id_ = old_photo_id;
file_reference_ = FileManager::extract_file_reference(input_photo);
send_query(G()->net_query_creator().create(telegram_api::photos_updateProfilePhoto(std::move(input_photo))));
send_query(
G()->net_query_creator().create(telegram_api::photos_updateProfilePhoto(std::move(input_photo)), {{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -592,8 +595,8 @@ class UpdateProfileQuery final : public Td::ResultHandler {
first_name_ = first_name;
last_name_ = last_name;
about_ = about;
send_query(
G()->net_query_creator().create(telegram_api::account_updateProfile(flags, first_name, last_name, about)));
send_query(G()->net_query_creator().create(telegram_api::account_updateProfile(flags, first_name, last_name, about),
{{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -647,7 +650,7 @@ class UpdateUsernameQuery final : public Td::ResultHandler {
}
void send(const string &username) {
send_query(G()->net_query_creator().create(telegram_api::account_updateUsername(username)));
send_query(G()->net_query_creator().create(telegram_api::account_updateUsername(username), {{"me"}}));
}
void on_result(BufferSlice packet) final {
@ -684,7 +687,8 @@ class UpdateEmojiStatusQuery final : public Td::ResultHandler {
}
return make_tl_object<telegram_api::emojiStatus>(custom_emoji_id);
}();
send_query(G()->net_query_creator().create(telegram_api::account_updateEmojiStatus(std::move(emoji_status))));
send_query(
G()->net_query_creator().create(telegram_api::account_updateEmojiStatus(std::move(emoji_status)), {{"me"}}));
}
void on_result(BufferSlice packet) final {

View File

@ -4053,7 +4053,7 @@ void Td::send_update(tl_object_ptr<td_api::Update> &&object) {
case td_api::updateFileAddedToDownloads::ID / 2:
case td_api::updateFileDownload::ID / 2:
case td_api::updateFileRemovedFromDownloads::ID / 2:
case td_api::updateDefaultReactionType::ID:
case td_api::updateDefaultReactionType::ID / 2:
LOG(ERROR) << "Sending update: " << oneline(to_string(object));
break;
default: