From 3e538b732a0775b7f3428595f960f89ddb70cdc4 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 29 Apr 2025 09:37:41 +0400 Subject: [PATCH] Update API scheme on layer 203. --- Telegram/SourceFiles/apiwrap.cpp | 16 ++++++++++------ Telegram/SourceFiles/mtproto/scheme/api.tl | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index c5f407394b..f79c7e455d 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -301,12 +301,16 @@ void ApiWrap::topPromotionDone(const MTPhelp_PromoData &proxy) { }, [&](const MTPDhelp_promoData &data) { _session->data().processChats(data.vchats()); _session->data().processUsers(data.vusers()); - const auto peerId = peerFromMTP(data.vpeer()); - const auto history = _session->data().history(peerId); - _session->data().setTopPromoted( - history, - data.vpsa_type().value_or_empty(), - data.vpsa_message().value_or_empty()); + if (const auto peer = data.vpeer()) { + const auto peerId = peerFromMTP(*peer); + const auto history = _session->data().history(peerId); + _session->data().setTopPromoted( + history, + data.vpsa_type().value_or_empty(), + data.vpsa_message().value_or_empty()); + } else { + _session->data().setTopPromoted(nullptr, QString(), QString()); + } }); } diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index 90d399bde0..9c2351b24e 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -1304,7 +1304,7 @@ statsGraph#8ea464b6 flags:# json:DataJSON zoom_token:flags.0?string = StatsGraph stats.broadcastStats#396ca5fc period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post:StatsAbsValueAndPrev reactions_per_post:StatsAbsValueAndPrev views_per_story:StatsAbsValueAndPrev shares_per_story:StatsAbsValueAndPrev reactions_per_story:StatsAbsValueAndPrev enabled_notifications:StatsPercentValue growth_graph:StatsGraph followers_graph:StatsGraph mute_graph:StatsGraph top_hours_graph:StatsGraph interactions_graph:StatsGraph iv_interactions_graph:StatsGraph views_by_source_graph:StatsGraph new_followers_by_source_graph:StatsGraph languages_graph:StatsGraph reactions_by_emotion_graph:StatsGraph story_interactions_graph:StatsGraph story_reactions_by_emotion_graph:StatsGraph recent_posts_interactions:Vector = stats.BroadcastStats; help.promoDataEmpty#98f6ac75 expires:int = help.PromoData; -help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:Vector users:Vector psa_type:flags.1?string psa_message:flags.2?string = help.PromoData; +help.promoData#8a4d87a flags:# proxy:flags.0?true expires:int peer:flags.3?Peer psa_type:flags.1?string psa_message:flags.2?string pending_suggestions:Vector dismissed_suggestions:Vector custom_pending_suggestion:flags.4?PendingSuggestion chats:Vector users:Vector = help.PromoData; videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize; videoSizeEmojiMarkup#f85c413c emoji_id:long background_colors:Vector = VideoSize; @@ -1977,6 +1977,8 @@ payments.resaleStarGifts#947a12df flags:# count:int gifts:Vector next_ stories.canSendStoryCount#c387c04e count_remains:int = stories.CanSendStoryCount; +pendingSuggestion#e7e82e12 suggestion:string title:TextWithEntities description:TextWithEntities url:string = PendingSuggestion; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;