From 6848380bb746d3872e1798482ea417ab67c567d3 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 3 Apr 2024 05:13:19 +0300 Subject: [PATCH] Add supergroupFullInfo.can_get_revenue. --- td/generate/scheme/td_api.tl | 3 ++- td/telegram/ChatManager.cpp | 9 +++++++-- td/telegram/ChatManager.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index c6dbc4e57..39547e808 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -1184,6 +1184,7 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available +//@can_get_revenue True, if the supergroup or channel revenue statistics are available //@can_toggle_aggressive_anti_spam True, if aggressive anti-spam checks can be enabled or disabled in the supergroup //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, //-so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators @@ -1199,7 +1200,7 @@ supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus membe //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state diff --git a/td/telegram/ChatManager.cpp b/td/telegram/ChatManager.cpp index 306c60013..61ed151ec 100644 --- a/td/telegram/ChatManager.cpp +++ b/td/telegram/ChatManager.cpp @@ -2258,6 +2258,7 @@ void ChatManager::ChannelFull::store(StorerT &storer) const { STORE_FLAG(has_boost_count); STORE_FLAG(has_unrestrict_boost_count); STORE_FLAG(can_have_sponsored_messages); + STORE_FLAG(can_view_revenue); END_STORE_FLAGS(); } if (has_description) { @@ -2386,6 +2387,7 @@ void ChatManager::ChannelFull::parse(ParserT &parser) { PARSE_FLAG(has_boost_count); PARSE_FLAG(has_unrestrict_boost_count); PARSE_FLAG(can_have_sponsored_messages); + PARSE_FLAG(can_view_revenue); END_PARSE_FLAGS(); } if (has_description) { @@ -5364,6 +5366,7 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ auto can_have_sponsored_messages = !channel->restricted_sponsored_; auto has_aggressive_anti_spam_enabled = channel->antispam_; auto can_view_statistics = channel->can_view_stats_; + auto can_view_revenue = channel->can_view_revenue_; bool has_pinned_stories = channel->stories_pinned_available_; auto boost_count = channel->boosts_applied_; auto unrestrict_boost_count = channel->boosts_unrestrict_; @@ -5401,7 +5404,8 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ channel_full->has_aggressive_anti_spam_enabled != has_aggressive_anti_spam_enabled || channel_full->has_hidden_participants != has_hidden_participants || channel_full->has_pinned_stories != has_pinned_stories || channel_full->boost_count != boost_count || - channel_full->unrestrict_boost_count != unrestrict_boost_count) { + channel_full->unrestrict_boost_count != unrestrict_boost_count || + channel_full->can_view_revenue != can_view_revenue) { channel_full->participant_count = participant_count; channel_full->administrator_count = administrator_count; channel_full->restricted_count = restricted_count; @@ -5420,6 +5424,7 @@ void ChatManager::on_get_chat_full(tl_object_ptr &&chat_ channel_full->has_pinned_stories = has_pinned_stories; channel_full->boost_count = boost_count; channel_full->unrestrict_boost_count = unrestrict_boost_count; + channel_full->can_view_revenue = can_view_revenue; channel_full->is_changed = true; } @@ -8871,7 +8876,7 @@ tl_object_ptr ChatManager::get_supergroup_full_info_ channel_full->banned_count, DialogId(channel_full->linked_channel_id).get(), channel_full->slow_mode_delay, slow_mode_delay_expires_in, channel_full->can_get_participants, has_hidden_participants, can_hide_channel_participants(channel_id, channel_full).is_ok(), channel_full->can_set_sticker_set, - channel_full->can_set_location, channel_full->can_view_statistics, + channel_full->can_set_location, channel_full->can_view_statistics, channel_full->can_view_revenue, can_toggle_channel_aggressive_anti_spam(channel_id, channel_full).is_ok(), channel_full->is_all_history_available, channel_full->can_have_sponsored_messages, channel_full->has_aggressive_anti_spam_enabled, channel_full->has_pinned_stories, channel_full->boost_count, channel_full->unrestrict_boost_count, diff --git a/td/telegram/ChatManager.h b/td/telegram/ChatManager.h index 114394955..1ff4c89f8 100644 --- a/td/telegram/ChatManager.h +++ b/td/telegram/ChatManager.h @@ -580,6 +580,7 @@ class ChatManager final : public Actor { bool can_set_location = false; bool can_view_statistics = false; bool is_can_view_statistics_inited = false; + bool can_view_revenue = false; bool is_all_history_available = true; bool can_have_sponsored_messages = true; bool has_aggressive_anti_spam_enabled = false;