Remove legacy supports_settings fields.

This commit is contained in:
levlam 2023-10-04 17:24:52 +03:00
parent a98a9fb971
commit 3e3b4e8aa6
3 changed files with 9 additions and 12 deletions

View File

@ -1717,10 +1717,9 @@ loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 reque
//@description Contains information about a Web App found by its short name
//@web_app The Web App
//@supports_settings True, if the app supports "settings_button_pressed" event
//@request_write_access True, if the user must be asked for the permission to the bot to send them messages
//@skip_confirmation True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden
foundWebApp web_app:webApp supports_settings:Bool request_write_access:Bool skip_confirmation:Bool = FoundWebApp;
foundWebApp web_app:webApp request_write_access:Bool skip_confirmation:Bool = FoundWebApp;
//@description Contains information about a Web App @launch_id Unique identifier for the Web App launch @url A Web App URL to open in a web view
webAppInfo launch_id:int64 url:string = WebAppInfo;
@ -3728,7 +3727,6 @@ attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotCol
//@supports_bot_chats True, if the bot supports opening from attachment menu in private chats with other bots
//@supports_group_chats True, if the bot supports opening from attachment menu in basic group and supergroup chats
//@supports_channel_chats True, if the bot supports opening from attachment menu in channel chats
//@supports_settings True, if the bot supports "settings_button_pressed" event
//@request_write_access True, if the user must be asked for the permission to send messages to the bot
//@is_added True, if the bot was explicitly added by the user. If the bot isn't added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed
//@show_in_attachment_menu True, if the bot must be shown in the attachment menu
@ -3746,7 +3744,7 @@ attachmentMenuBotColor light_color:int32 dark_color:int32 = AttachmentMenuBotCol
//@macos_side_menu_icon Icon for the bot in PNG format for the official macOS app side menu; may be null
//@icon_color Color to highlight selected icon of the bot if appropriate; may be null
//@web_app_placeholder Default placeholder for opened Web Apps in SVG format; may be null
attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool supports_settings:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot;
attachmentMenuBot bot_user_id:int53 supports_self_chat:Bool supports_user_chats:Bool supports_bot_chats:Bool supports_group_chats:Bool supports_channel_chats:Bool request_write_access:Bool is_added:Bool show_in_attachment_menu:Bool show_in_side_menu:Bool show_disclaimer_in_side_menu:Bool name:string name_color:attachmentMenuBotColor default_icon:file ios_static_icon:file ios_animated_icon:file ios_side_menu_icon:file android_icon:file android_side_menu_icon:file macos_icon:file macos_side_menu_icon:file icon_color:attachmentMenuBotColor web_app_placeholder:file = AttachmentMenuBot;
//@description Information about the message sent by answerWebAppQuery @inline_message_id Identifier of the sent inline message, if known
sentWebAppMessage inline_message_id:string = SentWebAppMessage;

View File

@ -414,7 +414,7 @@ bool operator==(const AttachMenuManager::AttachMenuBot &lhs, const AttachMenuMan
lhs.supports_bot_dialogs_ == rhs.supports_bot_dialogs_ &&
lhs.supports_group_dialogs_ == rhs.supports_group_dialogs_ &&
lhs.supports_broadcast_dialogs_ == rhs.supports_broadcast_dialogs_ &&
lhs.supports_settings_ == rhs.supports_settings_ && lhs.request_write_access_ == rhs.request_write_access_ &&
lhs.request_write_access_ == rhs.request_write_access_ &&
lhs.show_in_attach_menu_ == rhs.show_in_attach_menu_ && lhs.show_in_side_menu_ == rhs.show_in_side_menu_ &&
lhs.side_menu_disclaimer_needed_ == rhs.side_menu_disclaimer_needed_ && lhs.name_ == rhs.name_ &&
lhs.default_icon_file_id_ == rhs.default_icon_file_id_ &&
@ -460,7 +460,7 @@ void AttachMenuManager::AttachMenuBot::store(StorerT &storer) const {
STORE_FLAG(supports_bot_dialogs_);
STORE_FLAG(supports_group_dialogs_);
STORE_FLAG(supports_broadcast_dialogs_);
STORE_FLAG(supports_settings_);
STORE_FLAG(false);
STORE_FLAG(has_placeholder_file_id);
STORE_FLAG(has_cache_version);
STORE_FLAG(request_write_access_);
@ -523,6 +523,7 @@ void AttachMenuManager::AttachMenuBot::parse(ParserT &parser) {
bool has_android_side_menu_icon_file_id;
bool has_ios_side_menu_icon_file_id;
bool has_macos_side_menu_icon_file_id;
bool legacy_supports_settings;
BEGIN_PARSE_FLAGS();
PARSE_FLAG(has_ios_static_icon_file_id);
PARSE_FLAG(has_ios_animated_icon_file_id);
@ -537,7 +538,7 @@ void AttachMenuManager::AttachMenuBot::parse(ParserT &parser) {
PARSE_FLAG(supports_bot_dialogs_);
PARSE_FLAG(supports_group_dialogs_);
PARSE_FLAG(supports_broadcast_dialogs_);
PARSE_FLAG(supports_settings_);
PARSE_FLAG(legacy_supports_settings);
PARSE_FLAG(has_placeholder_file_id);
PARSE_FLAG(has_cache_version);
PARSE_FLAG(request_write_access_);
@ -801,7 +802,7 @@ void AttachMenuManager::on_get_web_app(UserId bot_user_id, string web_app_short_
td_->file_manager_->add_file_source(file_id, file_source_id);
}
}
promise.set_value(td_api::make_object<td_api::foundWebApp>(web_app.get_web_app_object(td_), bot_app->has_settings_,
promise.set_value(td_api::make_object<td_api::foundWebApp>(web_app.get_web_app_object(td_),
bot_app->request_write_access_, !bot_app->inactive_));
}
@ -1051,7 +1052,6 @@ Result<AttachMenuManager::AttachMenuBot> AttachMenuManager::get_attach_menu_bot(
break;
}
}
attach_menu_bot.supports_settings_ = bot->has_settings_;
attach_menu_bot.request_write_access_ = bot->request_write_access_;
attach_menu_bot.show_in_attach_menu_ = bot->show_in_attach_menu_;
attach_menu_bot.show_in_side_menu_ = bot->show_in_side_menu_;
@ -1305,8 +1305,8 @@ td_api::object_ptr<td_api::attachmentMenuBot> AttachMenuManager::get_attachment_
return td_api::make_object<td_api::attachmentMenuBot>(
td_->contacts_manager_->get_user_id_object(bot.user_id_, "get_attachment_menu_bot_object"),
bot.supports_self_dialog_, bot.supports_user_dialogs_, bot.supports_bot_dialogs_, bot.supports_group_dialogs_,
bot.supports_broadcast_dialogs_, bot.supports_settings_, bot.request_write_access_, bot.is_added_,
bot.show_in_attach_menu_, bot.show_in_side_menu_, bot.side_menu_disclaimer_needed_, bot.name_,
bot.supports_broadcast_dialogs_, bot.request_write_access_, bot.is_added_, bot.show_in_attach_menu_,
bot.show_in_side_menu_, bot.side_menu_disclaimer_needed_, bot.name_,
get_attach_menu_bot_color_object(bot.name_color_), get_file(bot.default_icon_file_id_),
get_file(bot.ios_static_icon_file_id_), get_file(bot.ios_animated_icon_file_id_),
get_file(bot.ios_side_menu_icon_file_id_), get_file(bot.android_icon_file_id_),

View File

@ -104,7 +104,6 @@ class AttachMenuManager final : public Actor {
bool supports_bot_dialogs_ = false;
bool supports_group_dialogs_ = false;
bool supports_broadcast_dialogs_ = false;
bool supports_settings_ = false;
bool request_write_access_ = false;
bool show_in_attach_menu_ = false;
bool show_in_side_menu_ = false;