From 2f1821a6c414e4959a140587fbfd65c9a73429be Mon Sep 17 00:00:00 2001 From: levlam Date: Mon, 8 Nov 2021 15:26:22 +0300 Subject: [PATCH] Improve RequestActor td_ private field name. --- td/telegram/RequestActor.h | 8 +- td/telegram/Td.cpp | 398 +++++++++++++++++++------------------ 2 files changed, 204 insertions(+), 202 deletions(-) diff --git a/td/telegram/RequestActor.h b/td/telegram/RequestActor.h index 0823e0f6b..ef3f36e3d 100644 --- a/td/telegram/RequestActor.h +++ b/td/telegram/RequestActor.h @@ -26,7 +26,7 @@ template class RequestActor : public Actor { public: RequestActor(ActorShared td_id, uint64 request_id) - : td_id_(std::move(td_id)), td(td_id_.get().get_actor_unsafe()), request_id_(request_id) { + : td_id_(std::move(td_id)), td_(td_id_.get().get_actor_unsafe()), request_id_(request_id) { } void loop() override { @@ -65,8 +65,8 @@ class RequestActor : public Actor { auto error = future_.move_as_error(); if (error == Status::Error::HANGUP_ERROR_CODE>()) { // dropping query due to lost authorization or lost promise - // td may be already closed, so we should check is auth_manager_ is empty - bool is_authorized = td->auth_manager_ && td->auth_manager_->is_authorized(); + // Td may be already closed, so we should check is auth_manager_ is empty + bool is_authorized = td_->auth_manager_ && td_->auth_manager_->is_authorized(); if (is_authorized) { LOG(ERROR) << "Promise was lost"; do_send_error(Status::Error(500, "Query can't be answered due to a bug in TDLib")); @@ -101,7 +101,7 @@ class RequestActor : public Actor { protected: ActorShared td_id_; - Td *td; + Td *td_; void send_result(tl_object_ptr &&result) { send_closure(td_id_, &Td::send_result, request_id_, std::move(result)); diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index cc5c7d391..99f017f58 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -599,11 +599,11 @@ class GetMeRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { - user_id_ = td->contacts_manager_->get_me(std::move(promise)); + user_id_ = td_->contacts_manager_->get_me(std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_user_object(user_id_)); + send_result(td_->contacts_manager_->get_user_object(user_id_)); } public: @@ -615,11 +615,11 @@ class GetUserRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { - td->contacts_manager_->get_user(user_id_, get_tries(), std::move(promise)); + td_->contacts_manager_->get_user(user_id_, get_tries(), std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_user_object(user_id_)); + send_result(td_->contacts_manager_->get_user_object(user_id_)); } public: @@ -633,11 +633,11 @@ class GetUserFullInfoRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { - td->contacts_manager_->load_user_full(user_id_, get_tries() < 2, std::move(promise), "GetUserFullInfoRequest"); + td_->contacts_manager_->load_user_full(user_id_, get_tries() < 2, std::move(promise), "GetUserFullInfoRequest"); } void do_send_result() final { - send_result(td->contacts_manager_->get_user_full_info_object(user_id_)); + send_result(td_->contacts_manager_->get_user_full_info_object(user_id_)); } public: @@ -650,11 +650,11 @@ class GetGroupRequest final : public RequestActor<> { ChatId chat_id_; void do_run(Promise &&promise) final { - td->contacts_manager_->get_chat(chat_id_, get_tries(), std::move(promise)); + td_->contacts_manager_->get_chat(chat_id_, get_tries(), std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_basic_group_object(chat_id_)); + send_result(td_->contacts_manager_->get_basic_group_object(chat_id_)); } public: @@ -668,11 +668,11 @@ class GetGroupFullInfoRequest final : public RequestActor<> { ChatId chat_id_; void do_run(Promise &&promise) final { - td->contacts_manager_->load_chat_full(chat_id_, get_tries() < 2, std::move(promise), "getBasicGroupFullInfo"); + td_->contacts_manager_->load_chat_full(chat_id_, get_tries() < 2, std::move(promise), "getBasicGroupFullInfo"); } void do_send_result() final { - send_result(td->contacts_manager_->get_basic_group_full_info_object(chat_id_)); + send_result(td_->contacts_manager_->get_basic_group_full_info_object(chat_id_)); } public: @@ -685,11 +685,11 @@ class GetSupergroupRequest final : public RequestActor<> { ChannelId channel_id_; void do_run(Promise &&promise) final { - td->contacts_manager_->get_channel(channel_id_, get_tries(), std::move(promise)); + td_->contacts_manager_->get_channel(channel_id_, get_tries(), std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_supergroup_object(channel_id_)); + send_result(td_->contacts_manager_->get_supergroup_object(channel_id_)); } public: @@ -703,12 +703,12 @@ class GetSupergroupFullInfoRequest final : public RequestActor<> { ChannelId channel_id_; void do_run(Promise &&promise) final { - td->contacts_manager_->load_channel_full(channel_id_, get_tries() < 2, std::move(promise), - "GetSupergroupFullInfoRequest"); + td_->contacts_manager_->load_channel_full(channel_id_, get_tries() < 2, std::move(promise), + "GetSupergroupFullInfoRequest"); } void do_send_result() final { - send_result(td->contacts_manager_->get_supergroup_full_info_object(channel_id_)); + send_result(td_->contacts_manager_->get_supergroup_full_info_object(channel_id_)); } public: @@ -721,11 +721,11 @@ class GetSecretChatRequest final : public RequestActor<> { SecretChatId secret_chat_id_; void do_run(Promise &&promise) final { - td->contacts_manager_->get_secret_chat(secret_chat_id_, get_tries() < 2, std::move(promise)); + td_->contacts_manager_->get_secret_chat(secret_chat_id_, get_tries() < 2, std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_secret_chat_object(secret_chat_id_)); + send_result(td_->contacts_manager_->get_secret_chat_object(secret_chat_id_)); } public: @@ -740,14 +740,14 @@ class GetChatRequest final : public RequestActor<> { bool dialog_found_ = false; void do_run(Promise &&promise) final { - dialog_found_ = td->messages_manager_->load_dialog(dialog_id_, get_tries(), std::move(promise)); + dialog_found_ = td_->messages_manager_->load_dialog(dialog_id_, get_tries(), std::move(promise)); } void do_send_result() final { if (!dialog_found_) { send_error(Status::Error(400, "Chat is not accessible")); } else { - send_result(td->messages_manager_->get_chat_object(dialog_id_)); + send_result(td_->messages_manager_->get_chat_object(dialog_id_)); } } @@ -762,11 +762,11 @@ class GetChatFilterRequest final : public RequestActor<> { DialogFilterId dialog_filter_id_; void do_run(Promise &&promise) final { - td->messages_manager_->load_dialog_filter(dialog_filter_id_, get_tries() < 2, std::move(promise)); + td_->messages_manager_->load_dialog_filter(dialog_filter_id_, get_tries() < 2, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_chat_filter_object(dialog_filter_id_)); + send_result(td_->messages_manager_->get_chat_filter_object(dialog_filter_id_)); } public: @@ -782,7 +782,7 @@ class LoadChatsRequest final : public RequestActor<> { int32 limit_; void do_run(Promise &&promise) final { - td->messages_manager_->get_dialogs(dialog_list_id_, offset_, limit_, false, get_tries() < 2, std::move(promise)); + td_->messages_manager_->get_dialogs(dialog_list_id_, offset_, limit_, false, get_tries() < 2, std::move(promise)); } public: @@ -803,11 +803,11 @@ class SearchPublicChatRequest final : public RequestActor<> { DialogId dialog_id_; void do_run(Promise &&promise) final { - dialog_id_ = td->messages_manager_->search_public_dialog(username_, get_tries() < 3, std::move(promise)); + dialog_id_ = td_->messages_manager_->search_public_dialog(username_, get_tries() < 3, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_chat_object(dialog_id_)); + send_result(td_->messages_manager_->get_chat_object(dialog_id_)); } public: @@ -823,7 +823,7 @@ class SearchPublicChatsRequest final : public RequestActor<> { vector dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->messages_manager_->search_public_dialogs(query_, std::move(promise)); + dialog_ids_ = td_->messages_manager_->search_public_dialogs(query_, std::move(promise)); } void do_send_result() final { @@ -843,7 +843,7 @@ class SearchChatsRequest final : public RequestActor<> { std::pair> dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->messages_manager_->search_dialogs(query_, limit_, std::move(promise)); + dialog_ids_ = td_->messages_manager_->search_dialogs(query_, limit_, std::move(promise)); } void do_send_result() final { @@ -863,7 +863,7 @@ class SearchChatsOnServerRequest final : public RequestActor<> { vector dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->messages_manager_->search_dialogs_on_server(query_, limit_, std::move(promise)); + dialog_ids_ = td_->messages_manager_->search_dialogs_on_server(query_, limit_, std::move(promise)); } void do_send_result() final { @@ -884,8 +884,8 @@ class GetGroupsInCommonRequest final : public RequestActor<> { std::pair> dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->messages_manager_->get_common_dialogs(user_id_, offset_dialog_id_, limit_, get_tries() < 2, - std::move(promise)); + dialog_ids_ = td_->messages_manager_->get_common_dialogs(user_id_, offset_dialog_id_, limit_, get_tries() < 2, + std::move(promise)); } void do_send_result() final { @@ -903,7 +903,7 @@ class GetCreatedPublicChatsRequest final : public RequestActor<> { PublicDialogType type_; void do_run(Promise &&promise) final { - dialog_ids_ = td->contacts_manager_->get_created_public_dialogs(type_, std::move(promise)); + dialog_ids_ = td_->contacts_manager_->get_created_public_dialogs(type_, std::move(promise)); } void do_send_result() final { @@ -920,7 +920,7 @@ class GetSuitableDiscussionChatsRequest final : public RequestActor<> { vector dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->contacts_manager_->get_dialogs_for_discussion(std::move(promise)); + dialog_ids_ = td_->contacts_manager_->get_dialogs_for_discussion(std::move(promise)); } void do_send_result() final { @@ -936,7 +936,7 @@ class GetInactiveSupergroupChatsRequest final : public RequestActor<> { vector dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->contacts_manager_->get_inactive_channels(std::move(promise)); + dialog_ids_ = td_->contacts_manager_->get_inactive_channels(std::move(promise)); } void do_send_result() final { @@ -954,7 +954,7 @@ class GetRecentlyOpenedChatsRequest final : public RequestActor<> { std::pair> dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->messages_manager_->get_recently_opened_dialogs(limit_, std::move(promise)); + dialog_ids_ = td_->messages_manager_->get_recently_opened_dialogs(limit_, std::move(promise)); } void do_send_result() final { @@ -971,11 +971,11 @@ class GetMessageRequest final : public RequestOnceActor { FullMessageId full_message_id_; void do_run(Promise &&promise) final { - td->messages_manager_->get_message(full_message_id_, std::move(promise)); + td_->messages_manager_->get_message(full_message_id_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object(full_message_id_, "GetMessageRequest")); + send_result(td_->messages_manager_->get_message_object(full_message_id_, "GetMessageRequest")); } public: @@ -992,11 +992,11 @@ class GetRepliedMessageRequest final : public RequestOnceActor { void do_run(Promise &&promise) final { replied_message_id_ = - td->messages_manager_->get_replied_message(dialog_id_, message_id_, get_tries() < 3, std::move(promise)); + td_->messages_manager_->get_replied_message(dialog_id_, message_id_, get_tries() < 3, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object(replied_message_id_, "GetRepliedMessageRequest")); + send_result(td_->messages_manager_->get_message_object(replied_message_id_, "GetRepliedMessageRequest")); } public: @@ -1017,7 +1017,7 @@ class GetMessageThreadRequest final : public RequestActor { promise.set_value(std::move(message_thread_info_)); return; } - td->messages_manager_->get_message_thread(dialog_id_, message_id_, std::move(promise)); + td_->messages_manager_->get_message_thread(dialog_id_, message_id_, std::move(promise)); } void do_set_result(MessageThreadInfo &&result) final { @@ -1025,7 +1025,7 @@ class GetMessageThreadRequest final : public RequestActor { } void do_send_result() final { - send_result(td->messages_manager_->get_message_thread_info_object(message_thread_info_)); + send_result(td_->messages_manager_->get_message_thread_info_object(message_thread_info_)); } public: @@ -1040,12 +1040,12 @@ class GetChatPinnedMessageRequest final : public RequestOnceActor { MessageId pinned_message_id_; void do_run(Promise &&promise) final { - pinned_message_id_ = td->messages_manager_->get_dialog_pinned_message(dialog_id_, std::move(promise)); + pinned_message_id_ = td_->messages_manager_->get_dialog_pinned_message(dialog_id_, std::move(promise)); } void do_send_result() final { send_result( - td->messages_manager_->get_message_object({dialog_id_, pinned_message_id_}, "GetChatPinnedMessageRequest")); + td_->messages_manager_->get_message_object({dialog_id_, pinned_message_id_}, "GetChatPinnedMessageRequest")); } public: @@ -1061,11 +1061,12 @@ class GetCallbackQueryMessageRequest final : public RequestOnceActor { int64 callback_query_id_; void do_run(Promise &&promise) final { - td->messages_manager_->get_callback_query_message(dialog_id_, message_id_, callback_query_id_, std::move(promise)); + td_->messages_manager_->get_callback_query_message(dialog_id_, message_id_, callback_query_id_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object({dialog_id_, message_id_}, "GetCallbackQueryMessageRequest")); + send_result( + td_->messages_manager_->get_message_object({dialog_id_, message_id_}, "GetCallbackQueryMessageRequest")); } public: @@ -1083,11 +1084,11 @@ class GetMessagesRequest final : public RequestOnceActor { vector message_ids_; void do_run(Promise &&promise) final { - td->messages_manager_->get_messages(dialog_id_, message_ids_, std::move(promise)); + td_->messages_manager_->get_messages(dialog_id_, message_ids_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_messages_object(-1, dialog_id_, message_ids_, false, "GetMessagesRequest")); + send_result(td_->messages_manager_->get_messages_object(-1, dialog_id_, message_ids_, false, "GetMessagesRequest")); } public: @@ -1105,7 +1106,7 @@ class GetMessageEmbeddingCodeRequest final : public RequestActor<> { string html_; void do_run(Promise &&promise) final { - html_ = td->messages_manager_->get_message_embedding_code(full_message_id_, for_group_, std::move(promise)); + html_ = td_->messages_manager_->get_message_embedding_code(full_message_id_, for_group_, std::move(promise)); } void do_send_result() final { @@ -1131,7 +1132,7 @@ class GetMessageLinkInfoRequest final : public RequestActor { promise.set_value(std::move(message_link_info_)); return; } - td->messages_manager_->get_message_link_info(url_, std::move(promise)); + td_->messages_manager_->get_message_link_info(url_, std::move(promise)); } void do_set_result(MessageLinkInfo &&result) final { @@ -1139,7 +1140,7 @@ class GetMessageLinkInfoRequest final : public RequestActor { } void do_send_result() final { - send_result(td->messages_manager_->get_message_link_info_object(message_link_info_)); + send_result(td_->messages_manager_->get_message_link_info_object(message_link_info_)); } public: @@ -1154,12 +1155,12 @@ class EditMessageTextRequest final : public RequestOnceActor { tl_object_ptr input_message_content_; void do_run(Promise &&promise) final { - td->messages_manager_->edit_message_text(full_message_id_, std::move(reply_markup_), - std::move(input_message_content_), std::move(promise)); + td_->messages_manager_->edit_message_text(full_message_id_, std::move(reply_markup_), + std::move(input_message_content_), std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object(full_message_id_, "EditMessageTextRequest")); + send_result(td_->messages_manager_->get_message_object(full_message_id_, "EditMessageTextRequest")); } public: @@ -1181,12 +1182,12 @@ class EditMessageLiveLocationRequest final : public RequestOnceActor { int32 proximity_alert_radius_; void do_run(Promise &&promise) final { - td->messages_manager_->edit_message_live_location(full_message_id_, std::move(reply_markup_), std::move(location_), - heading_, proximity_alert_radius_, std::move(promise)); + td_->messages_manager_->edit_message_live_location(full_message_id_, std::move(reply_markup_), std::move(location_), + heading_, proximity_alert_radius_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object(full_message_id_, "EditMessageLiveLocationRequest")); + send_result(td_->messages_manager_->get_message_object(full_message_id_, "EditMessageLiveLocationRequest")); } public: @@ -1208,12 +1209,12 @@ class EditMessageMediaRequest final : public RequestOnceActor { tl_object_ptr input_message_content_; void do_run(Promise &&promise) final { - td->messages_manager_->edit_message_media(full_message_id_, std::move(reply_markup_), - std::move(input_message_content_), std::move(promise)); + td_->messages_manager_->edit_message_media(full_message_id_, std::move(reply_markup_), + std::move(input_message_content_), std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object(full_message_id_, "EditMessageMediaRequest")); + send_result(td_->messages_manager_->get_message_object(full_message_id_, "EditMessageMediaRequest")); } public: @@ -1233,12 +1234,12 @@ class EditMessageCaptionRequest final : public RequestOnceActor { tl_object_ptr caption_; void do_run(Promise &&promise) final { - td->messages_manager_->edit_message_caption(full_message_id_, std::move(reply_markup_), std::move(caption_), - std::move(promise)); + td_->messages_manager_->edit_message_caption(full_message_id_, std::move(reply_markup_), std::move(caption_), + std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object(full_message_id_, "EditMessageCaptionRequest")); + send_result(td_->messages_manager_->get_message_object(full_message_id_, "EditMessageCaptionRequest")); } public: @@ -1257,11 +1258,11 @@ class EditMessageReplyMarkupRequest final : public RequestOnceActor { tl_object_ptr reply_markup_; void do_run(Promise &&promise) final { - td->messages_manager_->edit_message_reply_markup(full_message_id_, std::move(reply_markup_), std::move(promise)); + td_->messages_manager_->edit_message_reply_markup(full_message_id_, std::move(reply_markup_), std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_message_object(full_message_id_, "EditMessageReplyMarkupRequest")); + send_result(td_->messages_manager_->get_message_object(full_message_id_, "EditMessageReplyMarkupRequest")); } public: @@ -1283,8 +1284,8 @@ class GetChatHistoryRequest final : public RequestActor<> { tl_object_ptr messages_; void do_run(Promise &&promise) final { - messages_ = td->messages_manager_->get_dialog_history(dialog_id_, from_message_id_, offset_, limit_, - get_tries() - 1, only_local_, std::move(promise)); + messages_ = td_->messages_manager_->get_dialog_history(dialog_id_, from_message_id_, offset_, limit_, + get_tries() - 1, only_local_, std::move(promise)); } void do_send_result() final { @@ -1317,13 +1318,13 @@ class GetMessageThreadHistoryRequest final : public RequestActor<> { std::pair> messages_; void do_run(Promise &&promise) final { - messages_ = td->messages_manager_->get_message_thread_history(dialog_id_, message_id_, from_message_id_, offset_, - limit_, random_id_, std::move(promise)); + messages_ = td_->messages_manager_->get_message_thread_history(dialog_id_, message_id_, from_message_id_, offset_, + limit_, random_id_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_messages_object(-1, messages_.first, messages_.second, true, - "GetMessageThreadHistoryRequest")); + send_result(td_->messages_manager_->get_messages_object(-1, messages_.first, messages_.second, true, + "GetMessageThreadHistoryRequest")); } public: @@ -1349,8 +1350,8 @@ class GetChatMessageCalendarRequest final : public RequestActor<> { td_api::object_ptr calendar_; void do_run(Promise &&promise) final { - calendar_ = td->messages_manager_->get_dialog_message_calendar(dialog_id_, from_message_id_, filter_, random_id_, - get_tries() == 3, std::move(promise)); + calendar_ = td_->messages_manager_->get_dialog_message_calendar(dialog_id_, from_message_id_, filter_, random_id_, + get_tries() == 3, std::move(promise)); } void do_send_result() final { @@ -1383,14 +1384,14 @@ class SearchChatMessagesRequest final : public RequestActor<> { std::pair> messages_; void do_run(Promise &&promise) final { - messages_ = td->messages_manager_->search_dialog_messages(dialog_id_, query_, sender_, from_message_id_, offset_, - limit_, filter_, top_thread_message_id_, random_id_, - get_tries() == 3, std::move(promise)); + messages_ = td_->messages_manager_->search_dialog_messages(dialog_id_, query_, sender_, from_message_id_, offset_, + limit_, filter_, top_thread_message_id_, random_id_, + get_tries() == 3, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_messages_object(messages_.first, dialog_id_, messages_.second, true, - "SearchChatMessagesRequest")); + send_result(td_->messages_manager_->get_messages_object(messages_.first, dialog_id_, messages_.second, true, + "SearchChatMessagesRequest")); } void do_send_error(Status &&status) final { @@ -1431,12 +1432,12 @@ class SearchSecretMessagesRequest final : public RequestActor<> { MessagesManager::FoundMessages found_messages_; void do_run(Promise &&promise) final { - found_messages_ = td->messages_manager_->offline_search_messages(dialog_id_, query_, offset_, limit_, filter_, - random_id_, std::move(promise)); + found_messages_ = td_->messages_manager_->offline_search_messages(dialog_id_, query_, offset_, limit_, filter_, + random_id_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_found_messages_object(found_messages_, "SearchSecretMessagesRequest")); + send_result(td_->messages_manager_->get_found_messages_object(found_messages_, "SearchSecretMessagesRequest")); } public: @@ -1468,14 +1469,14 @@ class SearchMessagesRequest final : public RequestActor<> { std::pair> messages_; void do_run(Promise &&promise) final { - messages_ = td->messages_manager_->search_messages(folder_id_, ignore_folder_id_, query_, offset_date_, - offset_dialog_id_, offset_message_id_, limit_, filter_, - min_date_, max_date_, random_id_, std::move(promise)); + messages_ = td_->messages_manager_->search_messages(folder_id_, ignore_folder_id_, query_, offset_date_, + offset_dialog_id_, offset_message_id_, limit_, filter_, + min_date_, max_date_, random_id_, std::move(promise)); } void do_send_result() final { send_result( - td->messages_manager_->get_messages_object(messages_.first, messages_.second, true, "SearchMessagesRequest")); + td_->messages_manager_->get_messages_object(messages_.first, messages_.second, true, "SearchMessagesRequest")); } void do_send_error(Status &&status) final { @@ -1515,13 +1516,13 @@ class SearchCallMessagesRequest final : public RequestActor<> { std::pair> messages_; void do_run(Promise &&promise) final { - messages_ = td->messages_manager_->search_call_messages(from_message_id_, limit_, only_missed_, random_id_, - get_tries() == 3, std::move(promise)); + messages_ = td_->messages_manager_->search_call_messages(from_message_id_, limit_, only_missed_, random_id_, + get_tries() == 3, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_messages_object(messages_.first, messages_.second, true, - "SearchCallMessagesRequest")); + send_result(td_->messages_manager_->get_messages_object(messages_.first, messages_.second, true, + "SearchCallMessagesRequest")); } public: @@ -1539,12 +1540,12 @@ class GetActiveLiveLocationMessagesRequest final : public RequestActor<> { vector full_message_ids_; void do_run(Promise &&promise) final { - full_message_ids_ = td->messages_manager_->get_active_live_location_messages(std::move(promise)); + full_message_ids_ = td_->messages_manager_->get_active_live_location_messages(std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_messages_object(-1, full_message_ids_, true, - "GetActiveLiveLocationMessagesRequest")); + send_result(td_->messages_manager_->get_messages_object(-1, full_message_ids_, true, + "GetActiveLiveLocationMessagesRequest")); } public: @@ -1560,11 +1561,11 @@ class GetChatMessageByDateRequest final : public RequestOnceActor { int64 random_id_; void do_run(Promise &&promise) final { - random_id_ = td->messages_manager_->get_dialog_message_by_date(dialog_id_, date_, std::move(promise)); + random_id_ = td_->messages_manager_->get_dialog_message_by_date(dialog_id_, date_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_dialog_message_by_date_object(random_id_)); + send_result(td_->messages_manager_->get_dialog_message_by_date_object(random_id_)); } public: @@ -1580,12 +1581,12 @@ class GetChatScheduledMessagesRequest final : public RequestActor<> { void do_run(Promise &&promise) final { message_ids_ = - td->messages_manager_->get_dialog_scheduled_messages(dialog_id_, get_tries() < 2, false, std::move(promise)); + td_->messages_manager_->get_dialog_scheduled_messages(dialog_id_, get_tries() < 2, false, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_messages_object(-1, dialog_id_, message_ids_, true, - "GetChatScheduledMessagesRequest")); + send_result(td_->messages_manager_->get_messages_object(-1, dialog_id_, message_ids_, true, + "GetChatScheduledMessagesRequest")); } public: @@ -1601,11 +1602,11 @@ class GetWebPagePreviewRequest final : public RequestOnceActor { int64 request_id_ = 0; void do_run(Promise &&promise) final { - request_id_ = td->web_pages_manager_->get_web_page_preview(std::move(text_), std::move(promise)); + request_id_ = td_->web_pages_manager_->get_web_page_preview(std::move(text_), std::move(promise)); } void do_send_result() final { - send_result(td->web_pages_manager_->get_web_page_preview_result(request_id_)); + send_result(td_->web_pages_manager_->get_web_page_preview_result(request_id_)); } public: @@ -1625,7 +1626,7 @@ class GetWebPageInstantViewRequest final : public RequestActor { promise.set_value(std::move(web_page_id_)); return; } - td->web_pages_manager_->get_web_page_instant_view(url_, force_full_, std::move(promise)); + td_->web_pages_manager_->get_web_page_instant_view(url_, force_full_, std::move(promise)); } void do_set_result(WebPageId &&result) final { @@ -1633,7 +1634,7 @@ class GetWebPageInstantViewRequest final : public RequestActor { } void do_send_result() final { - send_result(td->web_pages_manager_->get_web_page_instant_view_object(web_page_id_)); + send_result(td_->web_pages_manager_->get_web_page_instant_view_object(web_page_id_)); } public: @@ -1647,11 +1648,11 @@ class CreateChatRequest final : public RequestActor<> { bool force_; void do_run(Promise &&promise) final { - td->messages_manager_->create_dialog(dialog_id_, force_, std::move(promise)); + td_->messages_manager_->create_dialog(dialog_id_, force_, std::move(promise)); } void do_send_result() final { - send_result(td->messages_manager_->get_chat_object(dialog_id_)); + send_result(td_->messages_manager_->get_chat_object(dialog_id_)); } public: @@ -1668,12 +1669,12 @@ class CreateNewGroupChatRequest final : public RequestActor<> { DialogId dialog_id_; void do_run(Promise &&promise) final { - dialog_id_ = td->messages_manager_->create_new_group_chat(user_ids_, title_, random_id_, std::move(promise)); + dialog_id_ = td_->messages_manager_->create_new_group_chat(user_ids_, title_, random_id_, std::move(promise)); } void do_send_result() final { CHECK(dialog_id_.is_valid()); - send_result(td->messages_manager_->get_chat_object(dialog_id_)); + send_result(td_->messages_manager_->get_chat_object(dialog_id_)); } public: @@ -1694,7 +1695,7 @@ class CreateNewSecretChatRequest final : public RequestActor { promise.set_value(std::move(secret_chat_id_)); return; } - td->messages_manager_->create_new_secret_chat(user_id_, std::move(promise)); + td_->messages_manager_->create_new_secret_chat(user_id_, std::move(promise)); } void do_set_result(SecretChatId &&result) final { @@ -1706,12 +1707,12 @@ class CreateNewSecretChatRequest final : public RequestActor { CHECK(secret_chat_id_.is_valid()); // SecretChatActor will send this update by itself // But since the update may still be on its way, we will update essential fields here. - td->contacts_manager_->on_update_secret_chat( + td_->contacts_manager_->on_update_secret_chat( secret_chat_id_, 0 /* no access_hash */, user_id_, SecretChatState::Unknown, true /* it is outbound chat */, -1 /* unknown TTL */, 0 /* unknown creation date */, "" /* no key_hash */, 0, FolderId()); DialogId dialog_id(secret_chat_id_); - td->messages_manager_->force_create_dialog(dialog_id, "create new secret chat", true); - send_result(td->messages_manager_->get_chat_object(dialog_id)); + td_->messages_manager_->force_create_dialog(dialog_id, "create new secret chat", true); + send_result(td_->messages_manager_->get_chat_object(dialog_id)); } public: @@ -1731,13 +1732,13 @@ class CreateNewSupergroupChatRequest final : public RequestActor<> { DialogId dialog_id_; void do_run(Promise &&promise) final { - dialog_id_ = td->messages_manager_->create_new_channel_chat(title_, is_megagroup_, description_, location_, - for_import_, random_id_, std::move(promise)); + dialog_id_ = td_->messages_manager_->create_new_channel_chat(title_, is_megagroup_, description_, location_, + for_import_, random_id_, std::move(promise)); } void do_send_result() final { CHECK(dialog_id_.is_valid()); - send_result(td->messages_manager_->get_chat_object(dialog_id_)); + send_result(td_->messages_manager_->get_chat_object(dialog_id_)); } public: @@ -1761,12 +1762,12 @@ class UpgradeGroupChatToSupergroupChatRequest final : public RequestActor<> { DialogId result_dialog_id_; void do_run(Promise &&promise) final { - result_dialog_id_ = td->messages_manager_->migrate_dialog_to_megagroup(dialog_id_, std::move(promise)); + result_dialog_id_ = td_->messages_manager_->migrate_dialog_to_megagroup(dialog_id_, std::move(promise)); } void do_send_result() final { CHECK(result_dialog_id_.is_valid()); - send_result(td->messages_manager_->get_chat_object(result_dialog_id_)); + send_result(td_->messages_manager_->get_chat_object(result_dialog_id_)); } public: @@ -1781,12 +1782,12 @@ class GetChatAdministratorsRequest final : public RequestActor<> { vector administrators_; void do_run(Promise &&promise) final { - administrators_ = td->contacts_manager_->get_dialog_administrators(dialog_id_, get_tries(), std::move(promise)); + administrators_ = td_->contacts_manager_->get_dialog_administrators(dialog_id_, get_tries(), std::move(promise)); } void do_send_result() final { auto administrator_objects = transform( - administrators_, [contacts_manager = td->contacts_manager_.get()](const DialogAdministrator &administrator) { + administrators_, [contacts_manager = td_->contacts_manager_.get()](const DialogAdministrator &administrator) { return administrator.get_chat_administrator_object(contacts_manager); }); send_result(td_api::make_object(std::move(administrator_objects))); @@ -1803,11 +1804,11 @@ class CheckChatInviteLinkRequest final : public RequestActor<> { string invite_link_; void do_run(Promise &&promise) final { - td->contacts_manager_->check_dialog_invite_link(invite_link_, std::move(promise)); + td_->contacts_manager_->check_dialog_invite_link(invite_link_, std::move(promise)); } void do_send_result() final { - auto result = td->contacts_manager_->get_chat_invite_link_info_object(invite_link_); + auto result = td_->contacts_manager_->get_chat_invite_link_info_object(invite_link_); CHECK(result != nullptr); send_result(std::move(result)); } @@ -1828,7 +1829,7 @@ class JoinChatByInviteLinkRequest final : public RequestActor { promise.set_value(std::move(dialog_id_)); return; } - td->contacts_manager_->import_dialog_invite_link(invite_link_, std::move(promise)); + td_->contacts_manager_->import_dialog_invite_link(invite_link_, std::move(promise)); } void do_set_result(DialogId &&result) final { @@ -1837,8 +1838,8 @@ class JoinChatByInviteLinkRequest final : public RequestActor { void do_send_result() final { CHECK(dialog_id_.is_valid()); - td->messages_manager_->force_create_dialog(dialog_id_, "join chat by invite link"); - send_result(td->messages_manager_->get_chat_object(dialog_id_)); + td_->messages_manager_->force_create_dialog(dialog_id_, "join chat by invite link"); + send_result(td_->messages_manager_->get_chat_object(dialog_id_)); } public: @@ -1858,13 +1859,13 @@ class GetChatEventLogRequest final : public RequestOnceActor { int64 random_id_ = 0; void do_run(Promise &&promise) final { - random_id_ = td->messages_manager_->get_dialog_event_log(dialog_id_, query_, from_event_id_, limit_, filters_, - user_ids_, std::move(promise)); + random_id_ = td_->messages_manager_->get_dialog_event_log(dialog_id_, query_, from_event_id_, limit_, filters_, + user_ids_, std::move(promise)); } void do_send_result() final { CHECK(random_id_ != 0); - send_result(td->messages_manager_->get_chat_events_object(random_id_)); + send_result(td_->messages_manager_->get_chat_events_object(random_id_)); } public: @@ -1887,7 +1888,7 @@ class ImportContactsRequest final : public RequestActor<> { std::pair, vector> imported_contacts_; void do_run(Promise &&promise) final { - imported_contacts_ = td->contacts_manager_->import_contacts(contacts_, random_id_, std::move(promise)); + imported_contacts_ = td_->contacts_manager_->import_contacts(contacts_, random_id_, std::move(promise)); } void do_send_result() final { @@ -1895,7 +1896,7 @@ class ImportContactsRequest final : public RequestActor<> { CHECK(imported_contacts_.second.size() == contacts_.size()); send_result(make_tl_object(transform(imported_contacts_.first, [this](UserId user_id) { - return td->contacts_manager_->get_user_id_object( + return td_->contacts_manager_->get_user_id_object( user_id, "ImportContactsRequest"); }), std::move(imported_contacts_.second))); @@ -1915,11 +1916,11 @@ class SearchContactsRequest final : public RequestActor<> { std::pair> user_ids_; void do_run(Promise &&promise) final { - user_ids_ = td->contacts_manager_->search_contacts(query_, limit_, std::move(promise)); + user_ids_ = td_->contacts_manager_->search_contacts(query_, limit_, std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_users_object(user_ids_.first, user_ids_.second)); + send_result(td_->contacts_manager_->get_users_object(user_ids_.first, user_ids_.second)); } public: @@ -1932,7 +1933,7 @@ class RemoveContactsRequest final : public RequestActor<> { vector user_ids_; void do_run(Promise &&promise) final { - td->contacts_manager_->remove_contacts(user_ids_, std::move(promise)); + td_->contacts_manager_->remove_contacts(user_ids_, std::move(promise)); } public: @@ -1946,7 +1947,7 @@ class GetImportedContactCountRequest final : public RequestActor<> { int32 imported_contact_count_ = 0; void do_run(Promise &&promise) final { - imported_contact_count_ = td->contacts_manager_->get_imported_contact_count(std::move(promise)); + imported_contact_count_ = td_->contacts_manager_->get_imported_contact_count(std::move(promise)); } void do_send_result() final { @@ -1966,7 +1967,7 @@ class ChangeImportedContactsRequest final : public RequestActor<> { std::pair, vector> imported_contacts_; void do_run(Promise &&promise) final { - imported_contacts_ = td->contacts_manager_->change_imported_contacts(contacts_, random_id_, std::move(promise)); + imported_contacts_ = td_->contacts_manager_->change_imported_contacts(contacts_, random_id_, std::move(promise)); } void do_send_result() final { @@ -1974,7 +1975,7 @@ class ChangeImportedContactsRequest final : public RequestActor<> { CHECK(imported_contacts_.second.size() == contacts_size_); send_result(make_tl_object(transform(imported_contacts_.first, [this](UserId user_id) { - return td->contacts_manager_->get_user_id_object( + return td_->contacts_manager_->get_user_id_object( user_id, "ChangeImportedContactsRequest"); }), std::move(imported_contacts_.second))); @@ -1994,11 +1995,11 @@ class GetRecentInlineBotsRequest final : public RequestActor<> { vector user_ids_; void do_run(Promise &&promise) final { - user_ids_ = td->inline_queries_manager_->get_recent_inline_bots(std::move(promise)); + user_ids_ = td_->inline_queries_manager_->get_recent_inline_bots(std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_users_object(-1, user_ids_)); + send_result(td_->contacts_manager_->get_users_object(-1, user_ids_)); } public: @@ -2013,12 +2014,12 @@ class GetUserProfilePhotosRequest final : public RequestActor<> { std::pair> photos; void do_run(Promise &&promise) final { - photos = td->contacts_manager_->get_user_profile_photos(user_id_, offset_, limit_, std::move(promise)); + photos = td_->contacts_manager_->get_user_profile_photos(user_id_, offset_, limit_, std::move(promise)); } void do_send_result() final { // TODO create function get_user_profile_photos_object - auto result = transform(photos.second, [file_manager = td->file_manager_.get()](const Photo *photo) { + auto result = transform(photos.second, [file_manager = td_->file_manager_.get()](const Photo *photo) { CHECK(photo != nullptr); CHECK(!photo->is_empty()); return get_chat_photo_object(file_manager, *photo); @@ -2041,7 +2042,7 @@ class GetChatNotificationSettingsExceptionsRequest final : public RequestActor<> vector dialog_ids_; void do_run(Promise &&promise) final { - dialog_ids_ = td->messages_manager_->get_dialog_notification_settings_exceptions( + dialog_ids_ = td_->messages_manager_->get_dialog_notification_settings_exceptions( scope_, filter_scope_, compare_sound_, get_tries() < 3, std::move(promise)); } @@ -2066,7 +2067,7 @@ class GetScopeNotificationSettingsRequest final : public RequestActor<> { const ScopeNotificationSettings *notification_settings_ = nullptr; void do_run(Promise &&promise) final { - notification_settings_ = td->messages_manager_->get_scope_notification_settings(scope_, std::move(promise)); + notification_settings_ = td_->messages_manager_->get_scope_notification_settings(scope_, std::move(promise)); } void do_send_result() final { @@ -2087,11 +2088,11 @@ class GetStickersRequest final : public RequestActor<> { vector sticker_ids_; void do_run(Promise &&promise) final { - sticker_ids_ = td->stickers_manager_->get_stickers(emoji_, limit_, get_tries() < 2, std::move(promise)); + sticker_ids_ = td_->stickers_manager_->get_stickers(emoji_, limit_, get_tries() < 2, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_stickers_object(sticker_ids_)); + send_result(td_->stickers_manager_->get_stickers_object(sticker_ids_)); } public: @@ -2108,11 +2109,11 @@ class SearchStickersRequest final : public RequestActor<> { vector sticker_ids_; void do_run(Promise &&promise) final { - sticker_ids_ = td->stickers_manager_->search_stickers(emoji_, limit_, std::move(promise)); + sticker_ids_ = td_->stickers_manager_->search_stickers(emoji_, limit_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_stickers_object(sticker_ids_)); + send_result(td_->stickers_manager_->get_stickers_object(sticker_ids_)); } public: @@ -2127,11 +2128,11 @@ class GetInstalledStickerSetsRequest final : public RequestActor<> { vector sticker_set_ids_; void do_run(Promise &&promise) final { - sticker_set_ids_ = td->stickers_manager_->get_installed_sticker_sets(is_masks_, std::move(promise)); + sticker_set_ids_ = td_->stickers_manager_->get_installed_sticker_sets(is_masks_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_sets_object(-1, sticker_set_ids_, 1)); + send_result(td_->stickers_manager_->get_sticker_sets_object(-1, sticker_set_ids_, 1)); } public: @@ -2149,12 +2150,12 @@ class GetArchivedStickerSetsRequest final : public RequestActor<> { vector sticker_set_ids_; void do_run(Promise &&promise) final { - std::tie(total_count_, sticker_set_ids_) = td->stickers_manager_->get_archived_sticker_sets( + std::tie(total_count_, sticker_set_ids_) = td_->stickers_manager_->get_archived_sticker_sets( is_masks_, offset_sticker_set_id_, limit_, get_tries() < 2, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_sets_object(total_count_, sticker_set_ids_, 1)); + send_result(td_->stickers_manager_->get_sticker_sets_object(total_count_, sticker_set_ids_, 1)); } public: @@ -2173,11 +2174,11 @@ class GetTrendingStickerSetsRequest final : public RequestActor<> { int32 limit_; void do_run(Promise &&promise) final { - sticker_set_ids_ = td->stickers_manager_->get_featured_sticker_sets(offset_, limit_, std::move(promise)); + sticker_set_ids_ = td_->stickers_manager_->get_featured_sticker_sets(offset_, limit_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_sets_object(sticker_set_ids_.first, sticker_set_ids_.second, 5)); + send_result(td_->stickers_manager_->get_sticker_sets_object(sticker_set_ids_.first, sticker_set_ids_.second, 5)); } public: @@ -2193,11 +2194,11 @@ class GetAttachedStickerSetsRequest final : public RequestActor<> { vector sticker_set_ids_; void do_run(Promise &&promise) final { - sticker_set_ids_ = td->stickers_manager_->get_attached_sticker_sets(file_id_, std::move(promise)); + sticker_set_ids_ = td_->stickers_manager_->get_attached_sticker_sets(file_id_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_sets_object(-1, sticker_set_ids_, 5)); + send_result(td_->stickers_manager_->get_sticker_sets_object(-1, sticker_set_ids_, 5)); } public: @@ -2212,11 +2213,11 @@ class GetStickerSetRequest final : public RequestActor<> { StickerSetId sticker_set_id_; void do_run(Promise &&promise) final { - sticker_set_id_ = td->stickers_manager_->get_sticker_set(set_id_, std::move(promise)); + sticker_set_id_ = td_->stickers_manager_->get_sticker_set(set_id_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_set_object(sticker_set_id_)); + send_result(td_->stickers_manager_->get_sticker_set_object(sticker_set_id_)); } public: @@ -2232,11 +2233,11 @@ class SearchStickerSetRequest final : public RequestActor<> { StickerSetId sticker_set_id_; void do_run(Promise &&promise) final { - sticker_set_id_ = td->stickers_manager_->search_sticker_set(name_, std::move(promise)); + sticker_set_id_ = td_->stickers_manager_->search_sticker_set(name_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_set_object(sticker_set_id_)); + send_result(td_->stickers_manager_->get_sticker_set_object(sticker_set_id_)); } public: @@ -2255,11 +2256,11 @@ class SearchInstalledStickerSetsRequest final : public RequestActor<> { void do_run(Promise &&promise) final { sticker_set_ids_ = - td->stickers_manager_->search_installed_sticker_sets(is_masks_, query_, limit_, std::move(promise)); + td_->stickers_manager_->search_installed_sticker_sets(is_masks_, query_, limit_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_sets_object(sticker_set_ids_.first, sticker_set_ids_.second, 5)); + send_result(td_->stickers_manager_->get_sticker_sets_object(sticker_set_ids_.first, sticker_set_ids_.second, 5)); } public: @@ -2274,11 +2275,11 @@ class SearchStickerSetsRequest final : public RequestActor<> { vector sticker_set_ids_; void do_run(Promise &&promise) final { - sticker_set_ids_ = td->stickers_manager_->search_sticker_sets(query_, std::move(promise)); + sticker_set_ids_ = td_->stickers_manager_->search_sticker_sets(query_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_sticker_sets_object(-1, sticker_set_ids_, 5)); + send_result(td_->stickers_manager_->get_sticker_sets_object(-1, sticker_set_ids_, 5)); } public: @@ -2293,7 +2294,7 @@ class ChangeStickerSetRequest final : public RequestOnceActor { bool is_archived_; void do_run(Promise &&promise) final { - td->stickers_manager_->change_sticker_set(set_id_, is_installed_, is_archived_, std::move(promise)); + td_->stickers_manager_->change_sticker_set(set_id_, is_installed_, is_archived_, std::move(promise)); } public: @@ -2313,11 +2314,11 @@ class UploadStickerFileRequest final : public RequestOnceActor { FileId file_id; void do_run(Promise &&promise) final { - file_id = td->stickers_manager_->upload_sticker_file(user_id_, std::move(sticker_), std::move(promise)); + file_id = td_->stickers_manager_->upload_sticker_file(user_id_, std::move(sticker_), std::move(promise)); } void do_send_result() final { - send_result(td->file_manager_->get_file_object(file_id)); + send_result(td_->file_manager_->get_file_object(file_id)); } public: @@ -2336,16 +2337,16 @@ class CreateNewStickerSetRequest final : public RequestOnceActor { string software_; void do_run(Promise &&promise) final { - td->stickers_manager_->create_new_sticker_set(user_id_, title_, name_, is_masks_, std::move(stickers_), - std::move(software_), std::move(promise)); + td_->stickers_manager_->create_new_sticker_set(user_id_, title_, name_, is_masks_, std::move(stickers_), + std::move(software_), std::move(promise)); } void do_send_result() final { - auto set_id = td->stickers_manager_->search_sticker_set(name_, Auto()); + auto set_id = td_->stickers_manager_->search_sticker_set(name_, Auto()); if (!set_id.is_valid()) { return send_error(Status::Error(500, "Created sticker set not found")); } - send_result(td->stickers_manager_->get_sticker_set_object(set_id)); + send_result(td_->stickers_manager_->get_sticker_set_object(set_id)); } public: @@ -2367,15 +2368,15 @@ class AddStickerToSetRequest final : public RequestOnceActor { tl_object_ptr sticker_; void do_run(Promise &&promise) final { - td->stickers_manager_->add_sticker_to_set(user_id_, name_, std::move(sticker_), std::move(promise)); + td_->stickers_manager_->add_sticker_to_set(user_id_, name_, std::move(sticker_), std::move(promise)); } void do_send_result() final { - auto set_id = td->stickers_manager_->search_sticker_set(name_, Auto()); + auto set_id = td_->stickers_manager_->search_sticker_set(name_, Auto()); if (!set_id.is_valid()) { return send_error(Status::Error(500, "Sticker set not found")); } - send_result(td->stickers_manager_->get_sticker_set_object(set_id)); + send_result(td_->stickers_manager_->get_sticker_set_object(set_id)); } public: @@ -2394,15 +2395,15 @@ class SetStickerSetThumbnailRequest final : public RequestOnceActor { tl_object_ptr thumbnail_; void do_run(Promise &&promise) final { - td->stickers_manager_->set_sticker_set_thumbnail(user_id_, name_, std::move(thumbnail_), std::move(promise)); + td_->stickers_manager_->set_sticker_set_thumbnail(user_id_, name_, std::move(thumbnail_), std::move(promise)); } void do_send_result() final { - auto set_id = td->stickers_manager_->search_sticker_set(name_, Auto()); + auto set_id = td_->stickers_manager_->search_sticker_set(name_, Auto()); if (!set_id.is_valid()) { return send_error(Status::Error(500, "Sticker set not found")); } - send_result(td->stickers_manager_->get_sticker_set_object(set_id)); + send_result(td_->stickers_manager_->get_sticker_set_object(set_id)); } public: @@ -2421,11 +2422,11 @@ class GetRecentStickersRequest final : public RequestActor<> { vector sticker_ids_; void do_run(Promise &&promise) final { - sticker_ids_ = td->stickers_manager_->get_recent_stickers(is_attached_, std::move(promise)); + sticker_ids_ = td_->stickers_manager_->get_recent_stickers(is_attached_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_stickers_object(sticker_ids_)); + send_result(td_->stickers_manager_->get_stickers_object(sticker_ids_)); } public: @@ -2439,7 +2440,7 @@ class AddRecentStickerRequest final : public RequestActor<> { tl_object_ptr input_file_; void do_run(Promise &&promise) final { - td->stickers_manager_->add_recent_sticker(is_attached_, input_file_, std::move(promise)); + td_->stickers_manager_->add_recent_sticker(is_attached_, input_file_, std::move(promise)); } public: @@ -2455,7 +2456,7 @@ class RemoveRecentStickerRequest final : public RequestActor<> { tl_object_ptr input_file_; void do_run(Promise &&promise) final { - td->stickers_manager_->remove_recent_sticker(is_attached_, input_file_, std::move(promise)); + td_->stickers_manager_->remove_recent_sticker(is_attached_, input_file_, std::move(promise)); } public: @@ -2470,7 +2471,7 @@ class ClearRecentStickersRequest final : public RequestActor<> { bool is_attached_; void do_run(Promise &&promise) final { - td->stickers_manager_->clear_recent_stickers(is_attached_, std::move(promise)); + td_->stickers_manager_->clear_recent_stickers(is_attached_, std::move(promise)); } public: @@ -2484,11 +2485,11 @@ class GetFavoriteStickersRequest final : public RequestActor<> { vector sticker_ids_; void do_run(Promise &&promise) final { - sticker_ids_ = td->stickers_manager_->get_favorite_stickers(std::move(promise)); + sticker_ids_ = td_->stickers_manager_->get_favorite_stickers(std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_stickers_object(sticker_ids_)); + send_result(td_->stickers_manager_->get_stickers_object(sticker_ids_)); } public: @@ -2500,7 +2501,7 @@ class AddFavoriteStickerRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { - td->stickers_manager_->add_favorite_sticker(input_file_, std::move(promise)); + td_->stickers_manager_->add_favorite_sticker(input_file_, std::move(promise)); } public: @@ -2514,7 +2515,7 @@ class RemoveFavoriteStickerRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { - td->stickers_manager_->remove_favorite_sticker(input_file_, std::move(promise)); + td_->stickers_manager_->remove_favorite_sticker(input_file_, std::move(promise)); } public: @@ -2530,7 +2531,7 @@ class GetStickerEmojisRequest final : public RequestActor<> { vector emojis_; void do_run(Promise &&promise) final { - emojis_ = td->stickers_manager_->get_sticker_emojis(input_file_, std::move(promise)); + emojis_ = td_->stickers_manager_->get_sticker_emojis(input_file_, std::move(promise)); } void do_send_result() final { @@ -2552,8 +2553,8 @@ class SearchEmojisRequest final : public RequestActor<> { vector emojis_; void do_run(Promise &&promise) final { - emojis_ = td->stickers_manager_->search_emojis(text_, exact_match_, input_language_codes_, get_tries() < 2, - std::move(promise)); + emojis_ = td_->stickers_manager_->search_emojis(text_, exact_match_, input_language_codes_, get_tries() < 2, + std::move(promise)); } void do_send_result() final { @@ -2577,11 +2578,11 @@ class GetEmojiSuggestionsUrlRequest final : public RequestOnceActor { int64 random_id_; void do_run(Promise &&promise) final { - random_id_ = td->stickers_manager_->get_emoji_suggestions_url(language_code_, std::move(promise)); + random_id_ = td_->stickers_manager_->get_emoji_suggestions_url(language_code_, std::move(promise)); } void do_send_result() final { - send_result(td->stickers_manager_->get_emoji_suggestions_url_result(random_id_)); + send_result(td_->stickers_manager_->get_emoji_suggestions_url_result(random_id_)); } public: @@ -2594,13 +2595,14 @@ class GetSavedAnimationsRequest final : public RequestActor<> { vector animation_ids_; void do_run(Promise &&promise) final { - animation_ids_ = td->animations_manager_->get_saved_animations(std::move(promise)); + animation_ids_ = td_->animations_manager_->get_saved_animations(std::move(promise)); } void do_send_result() final { - send_result(make_tl_object(transform(std::move(animation_ids_), [td = td](FileId animation_id) { - return td->animations_manager_->get_animation_object(animation_id); - }))); + send_result( + make_tl_object(transform(std::move(animation_ids_), [td_ = td_](FileId animation_id) { + return td_->animations_manager_->get_animation_object(animation_id); + }))); } public: @@ -2612,7 +2614,7 @@ class AddSavedAnimationRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { - td->animations_manager_->add_saved_animation(input_file_, std::move(promise)); + td_->animations_manager_->add_saved_animation(input_file_, std::move(promise)); } public: @@ -2626,7 +2628,7 @@ class RemoveSavedAnimationRequest final : public RequestOnceActor { tl_object_ptr input_file_; void do_run(Promise &&promise) final { - td->animations_manager_->remove_saved_animation(input_file_, std::move(promise)); + td_->animations_manager_->remove_saved_animation(input_file_, std::move(promise)); } public: @@ -2646,12 +2648,12 @@ class GetInlineQueryResultsRequest final : public RequestOnceActor { uint64 query_hash_; void do_run(Promise &&promise) final { - query_hash_ = td->inline_queries_manager_->send_inline_query(bot_user_id_, dialog_id_, user_location_, query_, - offset_, std::move(promise)); + query_hash_ = td_->inline_queries_manager_->send_inline_query(bot_user_id_, dialog_id_, user_location_, query_, + offset_, std::move(promise)); } void do_send_result() final { - send_result(td->inline_queries_manager_->get_inline_query_results_object(query_hash_)); + send_result(td_->inline_queries_manager_->get_inline_query_results_object(query_hash_)); } public: @@ -2671,11 +2673,11 @@ class GetSupportUserRequest final : public RequestActor<> { UserId user_id_; void do_run(Promise &&promise) final { - user_id_ = td->contacts_manager_->get_support_user(std::move(promise)); + user_id_ = td_->contacts_manager_->get_support_user(std::move(promise)); } void do_send_result() final { - send_result(td->contacts_manager_->get_user_object(user_id_)); + send_result(td_->contacts_manager_->get_user_object(user_id_)); } public: @@ -2689,11 +2691,11 @@ class SearchBackgroundRequest final : public RequestActor<> { std::pair background_; void do_run(Promise &&promise) final { - background_ = td->background_manager_->search_background(name_, std::move(promise)); + background_ = td_->background_manager_->search_background(name_, std::move(promise)); } void do_send_result() final { - send_result(td->background_manager_->get_background_object(background_.first, false, &background_.second)); + send_result(td_->background_manager_->get_background_object(background_.first, false, &background_.second)); } public: @@ -2711,12 +2713,12 @@ class SetBackgroundRequest final : public RequestActor<> { BackgroundId background_id_; void do_run(Promise &&promise) final { - background_id_ = td->background_manager_->set_background(input_background_.get(), background_type_.get(), - for_dark_theme_, std::move(promise)); + background_id_ = td_->background_manager_->set_background(input_background_.get(), background_type_.get(), + for_dark_theme_, std::move(promise)); } void do_send_result() final { - send_result(td->background_manager_->get_background_object(background_id_, for_dark_theme_, nullptr)); + send_result(td_->background_manager_->get_background_object(background_id_, for_dark_theme_, nullptr)); } public: