From 6ddf241293c48f1efe19070fb086db278b538f8a Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 25 Dec 2024 16:20:52 +0400 Subject: [PATCH] Update API scheme on layer 196. --- Telegram/Resources/langs/lang.strings | 4 -- .../boxes/peers/verify_peers_box.cpp | 8 +--- .../boxes/peers/verify_peers_box.h | 1 - Telegram/SourceFiles/data/data_channel.cpp | 11 +++++ Telegram/SourceFiles/data/data_channel.h | 1 + Telegram/SourceFiles/data/data_session.cpp | 23 ++-------- Telegram/SourceFiles/data/data_user.cpp | 25 +++++++++++ Telegram/SourceFiles/data/data_user.h | 4 ++ .../history/view/history_view_fake_items.cpp | 2 +- .../info/profile/info_profile_actions.cpp | 10 +---- Telegram/SourceFiles/main/main_account.cpp | 2 +- Telegram/SourceFiles/mtproto/scheme/api.tl | 45 +++++++++++-------- .../SourceFiles/payments/payments_form.cpp | 2 - Telegram/SourceFiles/ui/unread_badge.h | 1 - 14 files changed, 77 insertions(+), 62 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index f017398da..d5c64f9e7 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1642,7 +1642,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_bot_verify_bot_sent" = "{name} has been notified and will receive your verification mark and description upon accepting."; "lng_bot_verify_bot_remove" = "This bot is already verified by you. Do you want to remove verification?"; "lng_bot_verify_bot_telegram" = "This bot is verified as official by the representatives of Telegram."; -"lng_bot_verify_bot_company" = "This bot was verified by {company}."; "lng_bot_verify_user_title" = "Verify User"; "lng_bot_verify_user_text" = "Do you want to verify {name} with your verification mark and description?"; "lng_bot_verify_user_about" = "You can customize your description for each account."; @@ -1650,7 +1649,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_bot_verify_user_sent" = "{name} has been notified and will receive your verification mark and description upon accepting."; "lng_bot_verify_user_remove" = "This account is already verified by you. Do you want to remove verification?"; "lng_bot_verify_user_telegram" = "This account is verified as official by the representatives of Telegram."; -"lng_bot_verify_user_company" = "This account was verified by {company}."; "lng_bot_verify_channel_title" = "Verify Channel"; "lng_bot_verify_channel_text" = "Do you want to verify {name} with your verification mark and description?"; "lng_bot_verify_channel_about" = "You can customize your description for each channel."; @@ -1658,7 +1656,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_bot_verify_channel_sent" = "{name} has been notified and will receive your verification mark and description upon accepting."; "lng_bot_verify_channel_remove" = "This channel is already verified by you. Do you want to remove verification?"; "lng_bot_verify_channel_telegram" = "This channel is verified as official by the representatives of Telegram."; -"lng_bot_verify_channel_company" = "This channel was verified by {company}."; "lng_bot_verify_group_title" = "Verify Group"; "lng_bot_verify_group_text" = "Do you want to verify {name} with your verification mark and description?"; "lng_bot_verify_group_about" = "You can customize your description for each group."; @@ -1666,7 +1663,6 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_bot_verify_group_sent" = "{name} has been notified and will receive your verification mark and description upon accepting."; "lng_bot_verify_group_remove" = "This group is already verified by you. Do you want to remove verification?"; "lng_bot_verify_group_telegram" = "This community is verified as official by the representatives of Telegram."; -"lng_bot_verify_group_company" = "This community was verified by {company}."; "lng_bot_verify_description_label" = "Description"; "lng_bot_verify_remove_title" = "Remove verification"; "lng_bot_verify_remove_submit" = "Remove"; diff --git a/Telegram/SourceFiles/boxes/peers/verify_peers_box.cpp b/Telegram/SourceFiles/boxes/peers/verify_peers_box.cpp index cafc5d3b0..4f488f095 100644 --- a/Telegram/SourceFiles/boxes/peers/verify_peers_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/verify_peers_box.cpp @@ -167,9 +167,7 @@ void Controller::confirmAdd(not_null peer) { box, st::createPollField, Ui::InputField::Mode::NoNewlines, - (settings - ? phrases.company(lt_company, rpl::single(settings->company)) - : rpl::single(QString())), + rpl::single(state->description), state->description ), st::createPollFieldPadding); state->field = field; @@ -261,7 +259,6 @@ VerifyPhrases PeerVerifyPhrases(not_null peer) { .sent = tr::lng_bot_verify_bot_sent, .remove = tr::lng_bot_verify_bot_remove, .telegram = tr::lng_bot_verify_bot_telegram, - .company = tr::lng_bot_verify_bot_company, }; } else { return { @@ -272,7 +269,6 @@ VerifyPhrases PeerVerifyPhrases(not_null peer) { .sent = tr::lng_bot_verify_user_sent, .remove = tr::lng_bot_verify_user_remove, .telegram = tr::lng_bot_verify_user_telegram, - .company = tr::lng_bot_verify_user_company, }; } } else if (peer->isBroadcast()) { @@ -284,7 +280,6 @@ VerifyPhrases PeerVerifyPhrases(not_null peer) { .sent = tr::lng_bot_verify_channel_sent, .remove = tr::lng_bot_verify_channel_remove, .telegram = tr::lng_bot_verify_channel_telegram, - .company = tr::lng_bot_verify_channel_company, }; } return { @@ -295,6 +290,5 @@ VerifyPhrases PeerVerifyPhrases(not_null peer) { .sent = tr::lng_bot_verify_group_sent, .remove = tr::lng_bot_verify_group_remove, .telegram = tr::lng_bot_verify_group_telegram, - .company = tr::lng_bot_verify_group_company, }; } diff --git a/Telegram/SourceFiles/boxes/peers/verify_peers_box.h b/Telegram/SourceFiles/boxes/peers/verify_peers_box.h index 5e2a1b3fb..32897cb86 100644 --- a/Telegram/SourceFiles/boxes/peers/verify_peers_box.h +++ b/Telegram/SourceFiles/boxes/peers/verify_peers_box.h @@ -33,6 +33,5 @@ struct VerifyPhrases { tr::phrase sent; tr::phrase<> remove; tr::phrase<> telegram; - tr::phrase company; }; [[nodiscard]] VerifyPhrases PeerVerifyPhrases(not_null peer); diff --git a/Telegram/SourceFiles/data/data_channel.cpp b/Telegram/SourceFiles/data/data_channel.cpp index 6810b0ee9..fb44f769a 100644 --- a/Telegram/SourceFiles/data/data_channel.cpp +++ b/Telegram/SourceFiles/data/data_channel.cpp @@ -729,6 +729,16 @@ void ChannelData::setVerifyDetails(Ui::VerifyDetails details) { } } +void ChannelData::setVerifyDetailsIcon(DocumentId iconId) { + if (!iconId) { + setVerifyDetails({}); + } else { + auto info = _verifyDetails ? *_verifyDetails : Ui::VerifyDetails(); + info.iconBgId = iconId; + setVerifyDetails(info); + } +} + void ChannelData::setAdminRights(ChatAdminRights rights) { if (rights == adminRights()) { return; @@ -1267,6 +1277,7 @@ void ApplyChannelUpdate( .paidEnabled = update.is_paid_reactions_available(), }); } + channel->setVerifyDetails(ParseVerifyDetails(update.vbot_verification())); channel->owner().stories().apply(channel, update.vstories()); channel->fullUpdated(); channel->setPendingRequestsCount( diff --git a/Telegram/SourceFiles/data/data_channel.h b/Telegram/SourceFiles/data/data_channel.h index 8aa67baee..8604360d2 100644 --- a/Telegram/SourceFiles/data/data_channel.h +++ b/Telegram/SourceFiles/data/data_channel.h @@ -377,6 +377,7 @@ public: not_null participant) const; void setVerifyDetails(Ui::VerifyDetails details); + void setVerifyDetailsIcon(DocumentId iconId); [[nodiscard]] Ui::VerifyDetails *verifyDetails() const { return _verifyDetails.get(); } diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 42735d270..36aa6bf8b 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -133,21 +133,6 @@ void CheckForSwitchInlineButton(not_null item) { } } -[[nodiscard]] Ui::VerifyDetails Parse(const MTPBotVerification *info) { - if (!info) { - return {}; - } - const auto &data = info->data(); - auto description = qs(data.vdescription().value_or_empty()); - const auto flags = TextParseLinks; - return { - .botId = UserId(data.vbot_id().v), - .iconBgId = DocumentId(data.vicon().v), - .company = qs(data.vcompany()), - .description = TextUtilities::ParseEntities(description, flags), - }; -} - [[nodiscard]] InlineImageLocation FindInlineThumbnail( const QVector &sizes) { const auto i = ranges::find( @@ -368,7 +353,6 @@ Ui::VerifyDetails Session::verifiedByTelegram() { return { .iconBgId = _verifiedByTelegramIconBgId, .iconFgId = _verifiedByTelegramIconFgId, - .company = u"Telegram"_q, }; } @@ -615,7 +599,7 @@ not_null Session::processUser(const MTPUser &data) { if (data.is_verified()) { result->setVerifyDetails(verifiedByTelegram()); } else { - result->setVerifyDetails(Parse(data.vbot_verification())); + result->setVerifyDetailsIcon(data.vbot_verification_icon().value_or_empty()); } if (minimal) { if (result->input.type() == mtpc_inputPeerEmpty) { @@ -1035,7 +1019,8 @@ not_null Session::processChat(const MTPChat &data) { if (data.is_verified()) { channel->setVerifyDetails(verifiedByTelegram()); } else { - channel->setVerifyDetails(Parse(data.vbot_verification())); + channel->setVerifyDetailsIcon( + data.vbot_verification_icon().value_or_empty()); } if (!minimal && storiesState) { result->setStoriesState(!storiesState->maxId @@ -4645,7 +4630,7 @@ void Session::serviceNotification( MTPPeerColor(), // color MTPPeerColor(), // profile_color MTPint(), // bot_active_users - MTPBotVerification())); + MTPlong())); // bot_verification_icon } const auto history = this->history(PeerData::kServiceNotificationsId); const auto insert = [=] { diff --git a/Telegram/SourceFiles/data/data_user.cpp b/Telegram/SourceFiles/data/data_user.cpp index ba0cc0f1b..291fa2d6c 100644 --- a/Telegram/SourceFiles/data/data_user.cpp +++ b/Telegram/SourceFiles/data/data_user.cpp @@ -570,6 +570,16 @@ void UserData::setVerifyDetails(Ui::VerifyDetails details) { } } +void UserData::setVerifyDetailsIcon(DocumentId iconId) { + if (!iconId) { + setVerifyDetails({}); + } else { + auto info = _verifyDetails ? *_verifyDetails : Ui::VerifyDetails(); + info.iconBgId = iconId; + setVerifyDetails(info); + } +} + const QString &UserData::phone() const { return _phone; } @@ -781,6 +791,7 @@ void ApplyUserUpdate(not_null user, const MTPDuserFull &update) { user->owner().businessInfo().applyGreetingSettings( FromMTP(&user->owner(), update.vbusiness_greeting_message())); } + user->setVerifyDetails(ParseVerifyDetails(update.vbot_verification())); user->owner().stories().apply(user, update.vstories()); @@ -802,4 +813,18 @@ StarRefProgram ParseStarRefProgram(const MTPStarRefProgram *program) { return result; } +Ui::VerifyDetails ParseVerifyDetails(const MTPBotVerification *info) { + if (!info) { + return {}; + } + const auto &data = info->data(); + const auto description = qs(data.vdescription()); + const auto flags = TextParseLinks; + return { + .botId = UserId(data.vbot_id().v), + .iconBgId = DocumentId(data.vicon().v), + .description = TextUtilities::ParseEntities(description, flags), + }; +} + } // namespace Data diff --git a/Telegram/SourceFiles/data/data_user.h b/Telegram/SourceFiles/data/data_user.h index 5be906976..4f9e660b6 100644 --- a/Telegram/SourceFiles/data/data_user.h +++ b/Telegram/SourceFiles/data/data_user.h @@ -193,6 +193,7 @@ public: [[nodiscard]] bool isUsernameEditable(QString username) const; void setVerifyDetails(Ui::VerifyDetails details); + void setVerifyDetailsIcon(DocumentId iconId); [[nodiscard]] Ui::VerifyDetails *verifyDetails() const { return _verifyDetails.get(); } @@ -293,4 +294,7 @@ void ApplyUserUpdate(not_null user, const MTPDuserFull &update); [[nodiscard]] StarRefProgram ParseStarRefProgram( const MTPStarRefProgram *program); +[[nodiscard]] Ui::VerifyDetails ParseVerifyDetails( + const MTPBotVerification *info); + } // namespace Data diff --git a/Telegram/SourceFiles/history/view/history_view_fake_items.cpp b/Telegram/SourceFiles/history/view/history_view_fake_items.cpp index b8ce8b680..ef7b2674f 100644 --- a/Telegram/SourceFiles/history/view/history_view_fake_items.cpp +++ b/Telegram/SourceFiles/history/view/history_view_fake_items.cpp @@ -61,7 +61,7 @@ PeerId GenerateUser(not_null history, const QString &name) { MTPPeerColor(), // color MTPPeerColor(), // profile_color MTPint(), // bot_active_users - MTPBotVerification())); + MTPlong())); // bot_verification_icon return peerId; } diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index c6085492c..a6e02400d 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -1853,15 +1853,9 @@ void DetailsFiller::setupAboutVerification() { Ui::AddDivider(inner); } else if (!info->description.empty()) { Ui::AddDividerText(inner, rpl::single(info->description)); - } else { + } else if (_peer->verifiedByTelegram()) { const auto phrases = PeerVerifyPhrases(peer); - Ui::AddDividerText( - inner, - (_peer->verifiedByTelegram() - ? phrases.telegram() - : phrases.company( - lt_company, - rpl::single(info->company)))); + Ui::AddDividerText(inner, phrases.telegram()); } inner->resizeToWidth(inner->width()); }, inner->lifetime()); diff --git a/Telegram/SourceFiles/main/main_account.cpp b/Telegram/SourceFiles/main/main_account.cpp index c44b79608..9a4190f34 100644 --- a/Telegram/SourceFiles/main/main_account.cpp +++ b/Telegram/SourceFiles/main/main_account.cpp @@ -174,7 +174,7 @@ void Account::createSession( MTPPeerColor(), // color MTPPeerColor(), // profile_color MTPint(), // bot_active_users - MTPBotVerification()), + MTPlong()), // bot_verification_icon serialized, streamVersion, std::move(settings)); diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index 5049d5ae6..96d3fce82 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -84,7 +84,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#d3bc4b7a id:long = User; -user#59476956 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification:flags2.14?BotVerification = User; +user#4b46c37e flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; @@ -99,11 +99,11 @@ userStatusLastMonth#65899777 flags:# by_me:flags.0?true = UserStatus; chatEmpty#29562865 id:long = Chat; chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat; chatForbidden#6592a1a7 id:long title:string = Chat; -channel#46aeac06 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification:flags2.13?BotVerification = Chat; +channel#e00998b7 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# stories_hidden:flags2.1?true stories_hidden_min:flags2.2?true stories_unavailable:flags2.3?true signature_profiles:flags2.12?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int usernames:flags2.0?Vector stories_max_id:flags2.4?int color:flags2.7?PeerColor profile_color:flags2.8?PeerColor emoji_status:flags2.9?EmojiStatus level:flags2.10?int subscription_until_date:flags2.11?int bot_verification_icon:flags2.13?long = Chat; channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat; chatFull#2633421b flags:# can_set_username:flags.7?true has_scheduled:flags.8?true translations_disabled:flags.19?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector available_reactions:flags.18?ChatReactions reactions_limit:flags.20?int = ChatFull; -channelFull#bbab348d flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet = ChatFull; +channelFull#9ff3b858 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true flags2:# can_delete_channel:flags2.0?true antispam:flags2.1?true participants_hidden:flags2.2?true translations_disabled:flags2.3?true stories_pinned_available:flags2.5?true view_forum_as_messages:flags2.6?true restricted_sponsored:flags2.11?true can_view_revenue:flags2.12?true paid_media_allowed:flags2.14?true can_view_stars_revenue:flags2.15?true paid_reactions_available:flags2.16?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string requests_pending:flags.28?int recent_requesters:flags.28?Vector default_send_as:flags.29?Peer available_reactions:flags.30?ChatReactions reactions_limit:flags2.13?int stories:flags2.4?PeerStories wallpaper:flags2.7?WallPaper boosts_applied:flags2.8?int boosts_unrestrict:flags2.9?int emojiset:flags2.10?StickerSet bot_verification:flags2.17?BotVerification = ChatFull; chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant; chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant; @@ -183,7 +183,8 @@ messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram = UserFull; +userFull#4d975bbc flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification = UserFull; contact#145ade0b user_id:long mutual:Bool = Contact; @@ -426,7 +427,6 @@ updateBusinessBotCallbackQuery#1ea2fda7 flags:# query_id:long user_id:long conne updateStarsRevenueStatus#a584b019 peer:Peer status:StarsRevenueStatus = Update; updateBotPurchasedPaidMedia#283bd312 user_id:long payload:string qts:int = Update; updatePaidReactionPrivacy#51ca7aec private:Bool = Update; -updateStarGiftUpgraded#767cde44 gift:UserStarGift to_gift:UserStarGift = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -925,7 +925,6 @@ upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mti payments.paymentForm#a0058751 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON additional_methods:flags.6?Vector saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?Vector users:Vector = payments.PaymentForm; payments.paymentFormStars#7bf6b15c flags:# form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice users:Vector = payments.PaymentForm; payments.paymentFormStarGift#b425cfe1 form_id:long invoice:Invoice = payments.PaymentForm; -payments.paymentFormStarGiftUpgrade#ed1802c6 form_id:long invoice:Invoice sample_attributes:Vector = payments.PaymentForm; payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo; @@ -1475,8 +1474,9 @@ inputInvoiceSlug#c326caef slug:string = InputInvoice; inputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice; inputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice; inputInvoiceChatInviteSubscription#34e793f1 hash:string = InputInvoice; -inputInvoiceStarGift#25d8c1d8 flags:# hide_name:flags.0?true user_id:InputUser gift_id:long message:flags.1?TextWithEntities = InputInvoice; -inputInvoiceStarGiftUpgrade#9b352120 flags:# keep_original_details:flags.0?true user_id:InputUser msg_id:int = InputInvoice; +inputInvoiceStarGift#25d8c1d8 flags:# hide_name:flags.0?true include_upgrade:flags.2?true user_id:InputUser gift_id:long message:flags.1?TextWithEntities = InputInvoice; +inputInvoiceStarGiftUpgrade#5ebe7262 flags:# keep_original_details:flags.0?true msg_id:int = InputInvoice; +inputInvoiceStarGiftTransfer#ae3ba9ed msg_id:int to_id:InputUser = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; @@ -1835,7 +1835,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#64dfc926 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount = StarsTransaction; +starsTransaction#64dfc926 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true id:string stars:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount = StarsTransaction; payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; @@ -1873,13 +1873,13 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; -starGift#49c577cd flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int = StarGift; +starGift#2cc73c8 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long = StarGift; starGiftUnique#6a1407cd id:long title:string num:int owner_id:long attributes:Vector availability_issued:int availability_total:int = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#901689ea hash:int gifts:Vector = payments.StarGifts; -userStarGift#2b97af02 flags:# name_hidden:flags.0?true unsaved:flags.5?true can_upgrade:flags.6?true from_id:flags.1?long date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int convert_stars:flags.4?long can_export_at:flags.7?int = UserStarGift; +userStarGift#325835e1 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true from_id:flags.1?long date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long = UserStarGift; payments.userStarGifts#6b65b517 flags:# count:int gifts:Vector next_offset:flags.0?string users:Vector = payments.UserStarGifts; @@ -1910,13 +1910,18 @@ messages.foundStickers#82c9e290 flags:# next_offset:flags.0?int hash:long sticke botVerifierSettings#b0cd6617 flags:# can_modify_custom_description:flags.1?true icon:long company:string custom_description:flags.0?string = BotVerifierSettings; -botVerification#4a1c6d3c flags:# bot_id:long icon:long company:string description:flags.0?string = BotVerification; +botVerification#f93cd45c bot_id:long icon:long description:string = BotVerification; -starGiftAttributeModel#a2f7a0d8 name:string document_id:long rarity_permille:int = StarGiftAttribute; -starGiftAttributePattern#b8b33e23 name:string document_id:long rarity_permille:int = StarGiftAttribute; +starGiftAttributeModel#39d99013 name:string document:Document rarity_permille:int = StarGiftAttribute; +starGiftAttributePattern#13acff19 name:string document:Document rarity_permille:int = StarGiftAttribute; starGiftAttributeBackdrop#94271762 name:string center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; starGiftAttributeOriginalDetails#c02c4f4b flags:# sender_id:flags.0?long recipient_id:long date:int message:flags.1?TextWithEntities = StarGiftAttribute; +payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector = payments.StarGiftUpgradePreview; + +users.users#62d706b8 users:Vector = users.Users; +users.usersSlice#315a4974 count:int users:Vector = users.Users; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -2461,6 +2466,7 @@ bots.checkDownloadFileParams#50077589 bot:InputUser file_name:string url:string bots.getAdminedBots#b0711d83 = Vector; bots.updateStarRefProgram#778b5ab3 flags:# bot:InputUser commission_permille:int duration_months:flags.0?int = StarRefProgram; bots.setCustomVerification#8b89dfbd flags:# enabled:flags.1?true bot:flags.0?InputUser peer:InputPeer custom_description:flags.2?string = Bool; +bots.getBotRecommendations#2855be61 flags:# bot:InputUser = users.Users; payments.getPaymentForm#37148dbb flags:# invoice:InputInvoice theme_params:flags.0?DataJSON = payments.PaymentForm; payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.PaymentReceipt; @@ -2494,15 +2500,18 @@ payments.fulfillStarsSubscription#cc5bebb3 peer:InputPeer subscription_id:string payments.getStarsGiveawayOptions#bd1efd3e = Vector; payments.getStarGifts#c4563590 hash:int = payments.StarGifts; payments.getUserStarGifts#5e72c7e1 user_id:InputUser offset:string limit:int = payments.UserStarGifts; -payments.saveStarGift#87acf08e flags:# unsave:flags.0?true user_id:InputUser msg_id:int = Bool; -payments.convertStarGift#421e027 user_id:InputUser msg_id:int = Bool; +payments.saveStarGift#92fd2aae flags:# unsave:flags.0?true msg_id:int = Bool; +payments.convertStarGift#72770c83 msg_id:int = Bool; payments.botCancelStarsSubscription#6dfa0622 flags:# restore:flags.0?true user_id:InputUser charge_id:string = Bool; payments.getConnectedStarRefBots#5869a553 flags:# peer:InputPeer offset_date:flags.2?int offset_link:flags.2?string limit:int = payments.ConnectedStarRefBots; payments.getConnectedStarRefBot#b7d998f0 peer:InputPeer bot:InputUser = payments.ConnectedStarRefBots; payments.getSuggestedStarRefBots#d6b48f7 flags:# order_by_revenue:flags.0?true order_by_date:flags.1?true peer:InputPeer offset:string limit:int = payments.SuggestedStarRefBots; payments.connectStarRefBot#7ed5348a peer:InputPeer bot:InputUser = payments.ConnectedStarRefBots; payments.editConnectedStarRefBot#e4fca4a3 flags:# revoked:flags.0?true peer:InputPeer link:string = payments.ConnectedStarRefBots; -payments.transferStarGift#e7ebd0d5 user_id:InputUser msg_id:int to_id:InputUser = Updates; +payments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgradePreview; +payments.upgradeStarGift#cf4f0781 flags:# keep_original_details:flags.0?true msg_id:int = Updates; +payments.transferStarGift#333fb526 msg_id:int to_id:InputUser = Updates; +payments.getUserStarGift#b502e4a5 msg_id:Vector = payments.UserStarGifts; stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet; stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet; diff --git a/Telegram/SourceFiles/payments/payments_form.cpp b/Telegram/SourceFiles/payments/payments_form.cpp index ddd121195..6431796e0 100644 --- a/Telegram/SourceFiles/payments/payments_form.cpp +++ b/Telegram/SourceFiles/payments/payments_form.cpp @@ -514,8 +514,6 @@ void Form::requestForm() { .starGiftForm = true, }; _updates.fire(CreditsPaymentStarted{ .data = formData }); - }, [&](const MTPDpayments_paymentFormStarGiftUpgrade &data) { - // todo gifts }); }).fail([=](const MTP::Error &error) { hideProgress(); diff --git a/Telegram/SourceFiles/ui/unread_badge.h b/Telegram/SourceFiles/ui/unread_badge.h index cc8b4ce13..e85b20a17 100644 --- a/Telegram/SourceFiles/ui/unread_badge.h +++ b/Telegram/SourceFiles/ui/unread_badge.h @@ -36,7 +36,6 @@ struct VerifyDetails { UserId botId = 0; DocumentId iconBgId = 0; DocumentId iconFgId = 0; - QString company; TextWithEntities description; explicit operator bool() const {