diff options
| -rw-r--r-- | CMakeLists.txt | 1 | ||||
| -rw-r--r-- | SplitSource.php | 3 | ||||
| -rw-r--r-- | td/telegram/MessageSendOptions.h | 52 | ||||
| -rw-r--r-- | td/telegram/MessagesManager.cpp | 2 | ||||
| -rw-r--r-- | td/telegram/MessagesManager.h | 37 |
5 files changed, 57 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 34a03707c..7b29f4598 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -894,6 +894,7 @@ set(TDLIB_SOURCE_PART2 td/telegram/MessageSearchOffset.h td/telegram/MessageSelfDestructType.h td/telegram/MessageSender.h + td/telegram/MessageSendOptions.h td/telegram/MessagesInfo.h td/telegram/MessagesManager.h td/telegram/MessageSource.h diff --git a/SplitSource.php b/SplitSource.php index 1bbd869e9..c2a1eec74 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -379,13 +379,14 @@ function split_file($file, $chunks, $undo) { 'MessageFullId' => 'MessageFullId', 'MessageId' => 'MessageId', 'message_import_manager[_(-](?![.]get[(][)])|MessageImportManager' => 'MessageImportManager', - 'message_query_manager[_(-](?![.]get[(][)])|MessageQueryManager' => 'MessageQueryManager', 'MessageLinkInfo' => 'MessageLinkInfo', + 'message_query_manager[_(-](?![.]get[(][)])|MessageQueryManager' => 'MessageQueryManager', 'MessageQuote' => 'MessageQuote', 'MessageReaction|UnreadMessageReaction|[a-z_]*message[a-z_]*reaction|reload_paid_reaction_privacy|get_chosen_tags' => 'MessageReaction', 'MessageReactor' => 'MessageReactor', 'MessageSearchOffset' => 'MessageSearchOffset', '[a-z_]*_message_sender' => 'MessageSender', + 'MessageSendOptions' => 'MessageSendOptions', 'messages_manager[_(-](?![.]get[(][)])|MessagesManager' => 'MessagesManager', 'MessageThreadInfo' => 'MessageThreadInfo', 'MessageTopic' => 'MessageTopic', diff --git a/td/telegram/MessageSendOptions.h b/td/telegram/MessageSendOptions.h new file mode 100644 index 000000000..48b7ccad9 --- /dev/null +++ b/td/telegram/MessageSendOptions.h @@ -0,0 +1,52 @@ +// +// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2026 +// +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +#pragma once + +#include "td/telegram/MessageEffectId.h" +#include "td/telegram/SuggestedPost.h" + +#include "td/utils/common.h" + +namespace td { + +struct MessageSendOptions { + bool disable_notification = false; + bool from_background = false; + bool update_stickersets_order = false; + bool protect_content = false; + bool allow_paid = false; + bool only_preview = false; + bool has_suggested_post = false; + int32 schedule_date = 0; + int32 schedule_repeat_period = 0; + int32 sending_id = 0; + MessageEffectId effect_id; + int64 paid_message_star_count = 0; + SuggestedPost suggested_post; + + MessageSendOptions() = default; + MessageSendOptions(bool disable_notification, bool from_background, bool update_stickersets_order, + bool protect_content, bool allow_paid, bool only_preview, bool has_suggested_post, + int32 schedule_date, int32 schedule_repeat_period, int32 sending_id, MessageEffectId effect_id, + int64 paid_message_star_count, SuggestedPost &&suggested_post) + : disable_notification(disable_notification) + , from_background(from_background) + , update_stickersets_order(update_stickersets_order) + , protect_content(protect_content) + , allow_paid(allow_paid) + , only_preview(only_preview) + , has_suggested_post(has_suggested_post) + , schedule_date(schedule_date) + , schedule_repeat_period(schedule_repeat_period) + , sending_id(sending_id) + , effect_id(effect_id) + , paid_message_star_count(paid_message_star_count) + , suggested_post(std::move(suggested_post)) { + } +}; + +} // namespace td diff --git a/td/telegram/MessagesManager.cpp b/td/telegram/MessagesManager.cpp index 534134fcc..7a5fe6b80 100644 --- a/td/telegram/MessagesManager.cpp +++ b/td/telegram/MessagesManager.cpp @@ -21122,7 +21122,7 @@ Status MessagesManager::check_paid_message_star_count(int64 &paid_message_star_c return Status::OK(); } -Result<MessagesManager::MessageSendOptions> MessagesManager::process_message_send_options( +Result<MessageSendOptions> MessagesManager::process_message_send_options( DialogId dialog_id, tl_object_ptr<td_api::messageSendOptions> &&options, bool allow_update_stickersets_order, bool allow_effect, bool allow_suggested_post, bool allow_repeat_period, int32 message_count) const { MessageSendOptions result; diff --git a/td/telegram/MessagesManager.h b/td/telegram/MessagesManager.h index 2bcc3d451..0706cbe86 100644 --- a/td/telegram/MessagesManager.h +++ b/td/telegram/MessagesManager.h @@ -41,6 +41,7 @@ #include "td/telegram/MessageReplyInfo.h" #include "td/telegram/MessageSearchFilter.h" #include "td/telegram/MessageSelfDestructType.h" +#include "td/telegram/MessageSendOptions.h" #include "td/telegram/MessagesInfo.h" #include "td/telegram/MessageSource.h" #include "td/telegram/MessageThreadInfo.h" @@ -1532,42 +1533,6 @@ class MessagesManager final : public Actor { Promise<Unit> success_promise; }; - struct MessageSendOptions { - bool disable_notification = false; - bool from_background = false; - bool update_stickersets_order = false; - bool protect_content = false; - bool allow_paid = false; - bool only_preview = false; - bool has_suggested_post = false; - int32 schedule_date = 0; - int32 schedule_repeat_period = 0; - int32 sending_id = 0; - MessageEffectId effect_id; - int64 paid_message_star_count = 0; - SuggestedPost suggested_post; - - MessageSendOptions() = default; - MessageSendOptions(bool disable_notification, bool from_background, bool update_stickersets_order, - bool protect_content, bool allow_paid, bool only_preview, bool has_suggested_post, - int32 schedule_date, int32 schedule_repeat_period, int32 sending_id, MessageEffectId effect_id, - int64 paid_message_star_count, SuggestedPost &&suggested_post) - : disable_notification(disable_notification) - , from_background(from_background) - , update_stickersets_order(update_stickersets_order) - , protect_content(protect_content) - , allow_paid(allow_paid) - , only_preview(only_preview) - , has_suggested_post(has_suggested_post) - , schedule_date(schedule_date) - , schedule_repeat_period(schedule_repeat_period) - , sending_id(sending_id) - , effect_id(effect_id) - , paid_message_star_count(paid_message_star_count) - , suggested_post(std::move(suggested_post)) { - } - }; - struct SuffixLoadQueries { bool suffix_load_done_ = false; bool suffix_load_has_query_ = false; |
