Add success promise to on_get_updates.

This commit is contained in:
levlam 2020-12-21 22:06:52 +03:00
parent 956e70d841
commit 7d73126506
10 changed files with 711 additions and 479 deletions

View File

@ -310,7 +310,7 @@ void CallActor::on_set_rating_query_result(NetQueryPtr net_query) {
return on_error(res.move_as_error());
}
call_state_.need_rating = false;
send_closure(G()->updates_manager(), &UpdatesManager::on_get_updates, res.move_as_ok());
send_closure(G()->updates_manager(), &UpdatesManager::on_get_updates, res.move_as_ok(), Promise<Unit>());
}
void CallActor::send_call_debug_information(string data, Promise<> promise) {
@ -730,7 +730,7 @@ void CallActor::on_discard_query_result(NetQueryPtr net_query) {
if (res.is_error()) {
return on_error(res.move_as_error());
}
send_closure(G()->updates_manager(), &UpdatesManager::on_get_updates, res.move_as_ok());
send_closure(G()->updates_manager(), &UpdatesManager::on_get_updates, res.move_as_ok(), Promise<Unit>());
}
void CallActor::flush_call_state() {

View File

@ -424,9 +424,7 @@ class AddContactQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for AddContactQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -457,9 +455,7 @@ class AcceptContactQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for AcceptContactQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -591,9 +587,7 @@ class DeleteContactsQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for DeleteContactsQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1140,9 +1134,7 @@ class ToggleChannelSignaturesQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for ToggleChannelSignaturesQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1185,10 +1177,17 @@ class ToggleChannelIsAllHistoryAvailableQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for TogglePreHistoryHiddenQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->on_update_channel_is_all_history_available(channel_id_, is_all_history_available_);
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(
std::move(ptr),
PromiseCreator::lambda([promise = std::move(promise_), channel_id = channel_id_,
is_all_history_available = is_all_history_available_](Unit result) mutable {
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
}
send_closure(G()->contacts_manager(), &ContactsManager::on_update_channel_is_all_history_available,
channel_id, is_all_history_available, std::move(promise));
}));
}
void on_error(uint64 id, Status status) override {
@ -1372,15 +1371,21 @@ class ToggleSlowModeQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for ToggleSlowModeQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->on_update_channel_slow_mode_delay(channel_id_, slow_mode_delay_);
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(
std::move(ptr), PromiseCreator::lambda([promise = std::move(promise_), channel_id = channel_id_,
slow_mode_delay = slow_mode_delay_](Unit result) mutable {
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
}
send_closure(G()->contacts_manager(), &ContactsManager::on_update_channel_slow_mode_delay, channel_id,
slow_mode_delay, std::move(promise));
}));
}
void on_error(uint64 id, Status status) override {
if (status.message() == "CHAT_NOT_MODIFIED") {
td->contacts_manager_->on_update_channel_slow_mode_delay(channel_id_, slow_mode_delay_);
td->contacts_manager_->on_update_channel_slow_mode_delay(channel_id_, slow_mode_delay_, Promise<Unit>());
if (!td->auth_manager_->is_bot()) {
promise_.set_value(Unit());
return;
@ -1456,9 +1461,7 @@ class DeleteChannelQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for DeleteChannelQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1487,9 +1490,7 @@ class AddChatUserQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for AddChatUserQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1667,10 +1668,13 @@ class ImportDialogInviteLinkQuery : public Td::ResultHandler {
LOG(ERROR) << "Receive wrong result for ImportDialogInviteLinkQuery: " << to_string(ptr);
return on_error(id, Status::Error(500, "Internal Server Error"));
}
auto dialog_id = dialog_ids[0];
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->invalidate_invite_link_info(invite_link_);
promise_.set_value(std::move(dialog_ids[0]));
td->updates_manager_->on_get_updates(
std::move(ptr), PromiseCreator::lambda([promise = std::move(promise_), dialog_id](Unit) mutable {
promise.set_value(std::move(dialog_id));
}));
}
void on_error(uint64 id, Status status) override {
@ -1699,9 +1703,7 @@ class DeleteChatUserQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for DeleteChatUserQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1733,9 +1735,7 @@ class JoinChannelQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for JoinChannelQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1769,10 +1769,8 @@ class InviteToChannelQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for InviteToChannelQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->invalidate_channel_full(channel_id_, false, false);
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1806,10 +1804,8 @@ class EditChannelAdminQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditChannelAdminQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->invalidate_channel_full(channel_id_, false, false);
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1843,10 +1839,8 @@ class EditChannelBannedQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditChannelBannedQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->invalidate_channel_full(channel_id_, false, false);
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1879,9 +1873,7 @@ class LeaveChannelQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for LeaveChannelQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1953,10 +1945,8 @@ class EditChannelCreatorQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditChannelCreatorQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->contacts_manager_->invalidate_channel_full(channel_id_, false, false);
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1985,9 +1975,7 @@ class MigrateChatQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for MigrateChatQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -12168,12 +12156,17 @@ void ContactsManager::on_update_channel_location(ChannelId channel_id, const Dia
}
}
void ContactsManager::on_update_channel_slow_mode_delay(ChannelId channel_id, int32 slow_mode_delay) {
void ContactsManager::on_update_channel_slow_mode_delay(ChannelId channel_id, int32 slow_mode_delay,
Promise<Unit> &&promise) {
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
}
auto channel_full = get_channel_full_force(channel_id, "on_update_channel_slow_mode_delay");
if (channel_full != nullptr) {
on_update_channel_full_slow_mode_delay(channel_full, channel_id, slow_mode_delay, 0);
update_channel_full(channel_full, channel_id);
}
promise.set_value(Unit());
}
void ContactsManager::on_update_channel_slow_mode_next_send_date(ChannelId channel_id, int32 slow_mode_next_send_date) {
@ -12210,17 +12203,19 @@ void ContactsManager::on_update_channel_full_bot_user_ids(ChannelFull *channel_f
}
}
void ContactsManager::on_update_channel_is_all_history_available(ChannelId channel_id, bool is_all_history_available) {
void ContactsManager::on_update_channel_is_all_history_available(ChannelId channel_id, bool is_all_history_available,
Promise<Unit> &&promise) {
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
}
CHECK(channel_id.is_valid());
auto channel_full = get_channel_full_force(channel_id, "on_update_channel_is_all_history_available");
if (channel_full == nullptr) {
return;
}
if (channel_full->is_all_history_available != is_all_history_available) {
if (channel_full != nullptr && channel_full->is_all_history_available != is_all_history_available) {
channel_full->is_all_history_available = is_all_history_available;
channel_full->is_changed = true;
update_channel_full(channel_full, channel_id);
}
promise.set_value(Unit());
}
void ContactsManager::on_update_channel_default_permissions(ChannelId channel_id,

View File

@ -196,9 +196,10 @@ class ContactsManager : public Actor {
void on_update_channel_sticker_set(ChannelId channel_id, StickerSetId sticker_set_id);
void on_update_channel_linked_channel_id(ChannelId channel_id, ChannelId group_channel_id);
void on_update_channel_location(ChannelId channel_id, const DialogLocation &location);
void on_update_channel_slow_mode_delay(ChannelId channel_id, int32 slow_mode_delay);
void on_update_channel_slow_mode_delay(ChannelId channel_id, int32 slow_mode_delay, Promise<Unit> &&promise);
void on_update_channel_slow_mode_next_send_date(ChannelId channel_id, int32 slow_mode_next_send_date);
void on_update_channel_is_all_history_available(ChannelId channel_id, bool is_all_history_available);
void on_update_channel_is_all_history_available(ChannelId channel_id, bool is_all_history_available,
Promise<Unit> &&promise);
void on_update_channel_default_permissions(ChannelId channel_id, RestrictedRights default_permissions);
void on_update_channel_administrator_count(ChannelId channel_id, int32 administrator_count);
void on_update_channel_participant(ChannelId channel_id, UserId user_id, int32 date,

View File

@ -16,6 +16,8 @@
#include "td/telegram/Td.h"
#include "td/telegram/UpdatesManager.h"
#include "td/actor/MultiPromise.h"
#include "td/utils/JsonBuilder.h"
#include "td/utils/Random.h"
@ -56,11 +58,12 @@ class CreateGroupCallQuery : public Td::ResultHandler {
LOG(ERROR) << "Receive wrong CreateGroupCallQuery response " << to_string(ptr);
return on_error(id, Status::Error(500, "Receive wrong response"));
}
auto group_call_id = group_call_ids[0];
td->updates_manager_->on_get_updates(std::move(ptr));
// TODO set promise after updates are processed
promise_.set_value(std::move(group_call_ids[0]));
td->updates_manager_->on_get_updates(
std::move(ptr), PromiseCreator::lambda([promise = std::move(promise_), group_call_id](Unit) mutable {
promise.set_value(std::move(group_call_id));
}));
}
void on_error(uint64 id, Status status) override {
@ -224,10 +227,7 @@ class ToggleGroupCallSettingsQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for ToggleGroupCallSettingsQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
// TODO set promise after updates are processed
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -255,10 +255,7 @@ class InviteToGroupCallQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for InviteToGroupCallQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
// TODO set promise after updates are processed
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -294,10 +291,7 @@ class EditGroupCallMemberQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditGroupCallMemberQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
// TODO set promise after updates are processed
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -358,10 +352,7 @@ class LeaveGroupCallQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for LeaveGroupCallQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
// TODO set promise after updates are processed
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -389,10 +380,7 @@ class DiscardGroupCallQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for DiscardGroupCallQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
// TODO set promise after updates are processed
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1503,9 +1491,10 @@ void GroupCallManager::process_join_group_call_response(InputGroupCallId input_g
}
LOG(INFO) << "Receive result for JoinGroupCallQuery: " << to_string(updates);
td_->updates_manager_->on_get_updates(std::move(updates));
promise.set_error(Status::Error(500, "Wrong join response received"));
td_->updates_manager_->on_get_updates(std::move(updates),
PromiseCreator::lambda([promise = std::move(promise)](Unit) mutable {
promise.set_error(Status::Error(500, "Wrong join response received"));
}));
}
Result<td_api::object_ptr<td_api::groupCallJoinResponse>> GroupCallManager::get_group_call_join_response_object(

View File

@ -243,7 +243,7 @@ class GetAllDraftsQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for GetAllDraftsQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
td->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
}
void on_error(uint64 id, Status status) override {
@ -610,9 +610,7 @@ class UpdateDialogPinnedMessageQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for UpdateDialogPinnedMessageQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1058,13 +1056,12 @@ class EditDialogPhotoQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditDialogPhotoQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
if (file_id_.is_valid() && was_uploaded_) {
td->file_manager_->delete_partial_remote_location(file_id_);
}
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1134,9 +1131,7 @@ class EditDialogTitleQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditDialogTitleQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -1178,9 +1173,7 @@ class EditDialogDefaultBannedRightsQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditDialogPermissionsQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -2338,9 +2331,7 @@ class BlockFromRepliesQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for BlockFromRepliesQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -2570,7 +2561,7 @@ class SendMessageActor : public NetActorOnce {
auto constructor_id = ptr->get_id();
if (constructor_id != telegram_api::updateShortSentMessage::ID) {
td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(), "SendMessage");
return td->updates_manager_->on_get_updates(std::move(ptr));
return td->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
}
auto sent_message = move_tl_object_as<telegram_api::updateShortSentMessage>(ptr);
td->messages_manager_->on_update_sent_text_message(random_id_, std::move(sent_message->media_),
@ -2636,7 +2627,7 @@ class StartBotQuery : public Td::ResultHandler {
LOG(INFO) << "Receive result for StartBotQuery for " << random_id_ << ": " << to_string(ptr);
// Result may contain messageActionChatAddUser
// td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(), "StartBot");
td->updates_manager_->on_get_updates(std::move(ptr));
td->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
}
void on_error(uint64 id, Status status) override {
@ -2680,7 +2671,7 @@ class SendInlineBotResultQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for SendInlineBotResultQuery for " << random_id_ << ": " << to_string(ptr);
td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(), "SendInlineBotResult");
td->updates_manager_->on_get_updates(std::move(ptr));
td->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
}
void on_error(uint64 id, Status status) override {
@ -2773,7 +2764,7 @@ class SendMultiMediaActor : public NetActorOnce {
td->updates_manager_->schedule_get_difference("Wrong sendMultiMedia result");
}
td->updates_manager_->on_get_updates(std::move(ptr));
td->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
}
void on_error(uint64 id, Status status) override {
@ -2867,7 +2858,7 @@ class SendMediaActor : public NetActorOnce {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for SendMediaQuery for " << random_id_ << ": " << to_string(ptr);
td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(), "SendMedia");
td->updates_manager_->on_get_updates(std::move(ptr));
td->updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
}
void on_error(uint64 id, Status status) override {
@ -3026,9 +3017,7 @@ class SendScheduledMessageActor : public NetActorOnce {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for SendScheduledMessageActor: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -3102,9 +3091,7 @@ class EditMessageActor : public NetActorOnce {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditMessageActor: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -3220,9 +3207,7 @@ class SetGameScoreActor : public NetActorOnce {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for SetGameScoreActor: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -3445,8 +3430,7 @@ class ForwardMessagesActor : public NetActorOnce {
td->updates_manager_->schedule_get_difference("Wrong forwardMessages result");
}
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -3494,8 +3478,7 @@ class SendScreenshotNotificationQuery : public Td::ResultHandler {
LOG(INFO) << "Receive result for SendScreenshotNotificationQuery for " << random_id_ << ": " << to_string(ptr);
td->messages_manager_->check_send_message_result(random_id_, dialog_id_, ptr.get(),
"SendScreenshotNotificationQuery");
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -3706,9 +3689,7 @@ class DeleteScheduledMessagesQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for DeleteScheduledMessagesQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -3801,9 +3782,7 @@ class GetNotifySettingsExceptionsQuery : public Td::ResultHandler {
for (auto &dialog_id : dialog_ids) {
td->messages_manager_->force_create_dialog(dialog_id, "GetNotifySettingsExceptionsQuery");
}
td->updates_manager_->on_get_updates(std::move(updates_ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(updates_ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -4185,8 +4164,7 @@ class EditPeerFoldersQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for EditPeerFoldersQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(std::move(ptr));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -29135,7 +29113,7 @@ void MessagesManager::on_create_new_dialog_success(int64 random_id, tl_object_pt
return on_create_new_dialog_fail(random_id, Status::Error(500, "Chat was created earlier"), std::move(promise));
}
td_->updates_manager_->on_get_updates(std::move(updates));
td_->updates_manager_->on_get_updates(std::move(updates), Promise<Unit>());
}
void MessagesManager::on_create_new_dialog_fail(int64 random_id, Status error, Promise<Unit> &&promise) {

View File

@ -361,8 +361,10 @@ class SendPaymentFormQuery : public Td::ResultHandler {
switch (payment_result->get_id()) {
case telegram_api::payments_paymentResult::ID: {
auto result = move_tl_object_as<telegram_api::payments_paymentResult>(payment_result);
G()->td().get_actor_unsafe()->updates_manager_->on_get_updates(std::move(result->updates_));
promise_.set_value(make_tl_object<td_api::paymentResult>(true, string()));
td->updates_manager_->on_get_updates(std::move(result->updates_),
PromiseCreator::lambda([promise = std::move(promise_)](Unit) mutable {
promise.set_value(make_tl_object<td_api::paymentResult>(true, string()));
}));
return;
}
case telegram_api::payments_paymentVerificationNeeded::ID: {
@ -410,9 +412,7 @@ class GetPaymentReceiptQuery : public Td::ResultHandler {
}
promise_.set_value(make_tl_object<td_api::paymentReceipt>(
payment_receipt->date_,
G()->td().get_actor_unsafe()->contacts_manager_->get_user_id_object(payments_provider_user_id,
"paymentReceipt"),
payment_receipt->date_, td->contacts_manager_->get_user_id_object(payments_provider_user_id, "paymentReceipt"),
convert_invoice(std::move(payment_receipt->invoice_)), convert_order_info(std::move(payment_receipt->info_)),
convert_shipping_option(std::move(payment_receipt->shipping_)),
std::move(payment_receipt->credentials_title_)));

View File

@ -224,9 +224,7 @@ class StopPollActor : public NetActorOnce {
auto result = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for StopPollQuery: " << to_string(result);
td->updates_manager_->on_get_updates(std::move(result));
promise_.set_value(Unit());
td->updates_manager_->on_get_updates(std::move(result), std::move(promise_));
}
void on_error(uint64 id, Status status) override {
@ -846,7 +844,7 @@ void PollManager::on_set_poll_answer(PollId poll_id, uint64 generation,
poll->was_saved = false;
}
if (result.is_ok()) {
td_->updates_manager_->on_get_updates(result.move_as_ok());
td_->updates_manager_->on_get_updates(result.move_as_ok(), Promise<Unit>());
for (auto &promise : promises) {
promise.set_value(Unit());
@ -1220,7 +1218,7 @@ void PollManager::on_get_poll_results(PollId poll_id, uint64 generation,
return;
}
td_->updates_manager_->on_get_updates(result.move_as_ok());
td_->updates_manager_->on_get_updates(result.move_as_ok(), Promise<Unit>());
}
void PollManager::on_online() {

View File

@ -3620,7 +3620,7 @@ void Td::on_result(NetQueryPtr query) {
LOG(ERROR) << "Failed to fetch update: " << parser.get_error() << format::as_hex_dump<4>(ok.as_slice());
updates_manager_->schedule_get_difference("failed to fetch update");
} else {
updates_manager_->on_get_updates(std::move(ptr));
updates_manager_->on_get_updates(std::move(ptr), Promise<Unit>());
if (auth_manager_->is_bot() && auth_manager_->is_authorized()) {
alarm_timeout_.set_timeout_in(PING_SERVER_ALARM_ID,
PING_SERVER_TIMEOUT + Random::fast(0, PING_SERVER_TIMEOUT / 5));

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ class UpdatesManager : public Actor {
public:
UpdatesManager(Td *td, ActorShared<> parent);
void on_get_updates(tl_object_ptr<telegram_api::Updates> &&updates_ptr);
void on_get_updates(tl_object_ptr<telegram_api::Updates> &&updates_ptr, Promise<Unit> &&promise);
void on_get_updates_state(tl_object_ptr<telegram_api::updates_state> &&state, const char *source);
@ -92,12 +92,20 @@ class UpdatesManager : public Actor {
int32 seq_end;
int32 date;
vector<tl_object_ptr<telegram_api::Update>> updates;
Promise<Unit> promise;
PendingUpdates(int32 seq_begin, int32 seq_end, int32 date, vector<tl_object_ptr<telegram_api::Update>> &&updates)
: seq_begin(seq_begin), seq_end(seq_end), date(date), updates(std::move(updates)) {
PendingUpdates(int32 seq_begin, int32 seq_end, int32 date, vector<tl_object_ptr<telegram_api::Update>> &&updates,
Promise<Unit> &&promise)
: seq_begin(seq_begin), seq_end(seq_end), date(date), updates(std::move(updates)), promise(std::move(promise)) {
}
};
class PendingQtsUpdate {
public:
tl_object_ptr<telegram_api::Update> update;
Promise<Unit> promise;
};
Td *td_;
ActorShared<> parent_;
@ -112,7 +120,7 @@ class UpdatesManager : public Actor {
std::multimap<int32, PendingUpdates> postponed_updates_; // updates received during getDifference
std::multimap<int32, PendingUpdates> pending_seq_updates_; // updates with too big seq
std::map<int32, tl_object_ptr<telegram_api::Update>> pending_qts_updates_; // updates with too big qts
std::map<int32, PendingQtsUpdate> pending_qts_updates_; // updates with too big qts
Timeout seq_gap_timeout_;
@ -142,18 +150,21 @@ class UpdatesManager : public Actor {
vector<tl_object_ptr<telegram_api::EncryptedMessage>> &&new_encrypted_messages,
vector<tl_object_ptr<telegram_api::Update>> &&other_updates);
void on_pending_update(tl_object_ptr<telegram_api::Update> update, int32 seq, const char *source);
void on_pending_update(tl_object_ptr<telegram_api::Update> update, int32 seq, Promise<Unit> &&promise,
const char *source);
void add_pending_qts_update(tl_object_ptr<telegram_api::Update> &&update, int32 qts);
void add_pending_qts_update(tl_object_ptr<telegram_api::Update> &&update, int32 qts, Promise<Unit> &&promise);
void on_pending_updates(vector<tl_object_ptr<telegram_api::Update>> &&updates, int32 seq_begin, int32 seq_end,
int32 date, const char *source);
int32 date, Promise<Unit> &&promise, const char *source);
void process_updates(vector<tl_object_ptr<telegram_api::Update>> &&updates, bool force_apply);
void process_updates(vector<tl_object_ptr<telegram_api::Update>> &&updates, bool force_apply,
Promise<Unit> &&promise);
void process_seq_updates(int32 seq_end, int32 date, vector<tl_object_ptr<telegram_api::Update>> &&updates);
void process_seq_updates(int32 seq_end, int32 date, vector<tl_object_ptr<telegram_api::Update>> &&updates,
Promise<Unit> &&promise);
void process_qts_update(tl_object_ptr<telegram_api::Update> &&update_ptr, int32 qts);
void process_qts_update(tl_object_ptr<telegram_api::Update> &&update_ptr, int32 qts, Promise<Unit> &&promise);
void process_pending_seq_updates();
@ -199,133 +210,185 @@ class UpdatesManager : public Actor {
bool is_acceptable_update(const telegram_api::Update *update) const;
void on_update(tl_object_ptr<telegram_api::updateNewMessage> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateMessageID> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateReadMessagesContents> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateEditMessage> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateDeleteMessages> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateReadHistoryInbox> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateReadHistoryOutbox> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateNotifySettings> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePeerSettings> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePeerLocated> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateNewMessage> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateMessageID> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadMessagesContents> update, bool force_apply,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateEditMessage> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDeleteMessages> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadHistoryInbox> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadHistoryOutbox> update, bool force_apply,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateNotifySettings> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePeerSettings> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePeerLocated> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateWebPage> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateChannelWebPage> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateWebPage> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelWebPage> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateFolderPeers> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateFolderPeers> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateUserTyping> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatUserTyping> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChannelUserTyping> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateEncryptedChatTyping> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateUserTyping> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChatUserTyping> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelUserTyping> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateEncryptedChatTyping> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateUserStatus> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateUserName> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateUserPhone> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateUserPhoto> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateUserStatus> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateUserName> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateUserPhone> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateUserPhoto> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePeerBlocked> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePeerBlocked> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChatParticipants> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatParticipantAdd> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatParticipantAdmin> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatParticipantDelete> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatParticipants> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChatParticipantAdd> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChatParticipantAdmin> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChatParticipantDelete> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChatDefaultBannedRights> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChatDefaultBannedRights> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateServiceNotification> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateServiceNotification> update, bool force_apply,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDcOptions> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDcOptions> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChat> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChat> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateNewChannelMessage> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateReadChannelInbox> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateReadChannelOutbox> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChannelReadMessagesContents> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChannelTooLong> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateChannel> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateEditChannelMessage> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDeleteChannelMessages> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChannelMessageViews> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChannelMessageForwards> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChannelAvailableMessages> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateNewChannelMessage> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadChannelInbox> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadChannelOutbox> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelReadMessagesContents> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelTooLong> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannel> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateEditChannelMessage> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDeleteChannelMessages> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelMessageViews> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelMessageForwards> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelAvailableMessages> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadChannelDiscussionInbox> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateReadChannelDiscussionOutbox> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateReadChannelDiscussionInbox> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadChannelDiscussionOutbox> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePinnedMessages> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updatePinnedChannelMessages> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePinnedMessages> update, bool force_apply, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePinnedChannelMessages> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDraftMessage> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDraftMessage> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDialogPinned> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePinnedDialogs> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogUnreadMark> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogPinned> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePinnedDialogs> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDialogUnreadMark> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDialogFilter> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogFilters> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogFilterOrder> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDialogFilter> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDialogFilters> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDialogFilterOrder> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotInlineQuery> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateBotInlineSend> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateBotInlineQuery> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotInlineSend> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotCallbackQuery> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateInlineBotCallbackQuery> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateBotCallbackQuery> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateInlineBotCallbackQuery> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateFavedStickers> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateFavedStickers> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateSavedGifs> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateSavedGifs> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateConfig> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateConfig> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePtsChanged> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePtsChanged> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePrivacy> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePrivacy> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateEncryption> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateNewEncryptedMessage> update, bool force_apply);
void on_update(tl_object_ptr<telegram_api::updateEncryptedMessagesRead> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateEncryption> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateNewEncryptedMessage> update, bool force_apply,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateEncryptedMessagesRead> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateNewStickerSet> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateStickerSets> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateStickerSetsOrder> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateReadFeaturedStickers> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateRecentStickers> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateNewStickerSet> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateStickerSets> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateStickerSetsOrder> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateReadFeaturedStickers> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateRecentStickers> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotShippingQuery> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateBotPrecheckoutQuery> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateBotShippingQuery> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotPrecheckoutQuery> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotWebhookJSON> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateBotWebhookJSONQuery> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateBotWebhookJSON> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateBotWebhookJSONQuery> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePhoneCall> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePhoneCallSignalingData> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updatePhoneCall> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updatePhoneCallSignalingData> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateGroupCall> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateGroupCallParticipants> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateGroupCall> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateGroupCallParticipants> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateContactsReset> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateContactsReset> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateLangPackTooLong> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateLangPack> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateLangPackTooLong> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateLangPack> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateGeoLiveViewed> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateGeoLiveViewed> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateMessagePoll> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateMessagePollVote> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateMessagePoll> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateMessagePollVote> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateNewScheduledMessage> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateDeleteScheduledMessages> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateNewScheduledMessage> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateDeleteScheduledMessages> update, bool /*force_apply*/,
Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateLoginToken> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateLoginToken> update, bool /*force_apply*/, Promise<Unit> &&promise);
void on_update(tl_object_ptr<telegram_api::updateChannelParticipant> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateChannelParticipant> update, bool /*force_apply*/,
Promise<Unit> &&promise);
// unsupported updates
void on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/);
void on_update(tl_object_ptr<telegram_api::updateTheme> update, bool /*force_apply*/, Promise<Unit> &&promise);
};
} // namespace td