From 8d632bd2be9a24728be118470c9a30df7daf6654 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 24 Apr 2020 14:31:28 +0400 Subject: [PATCH] Update API scheme to layer 103. --- Telegram/Resources/tl/api.tl | 13 ++-- Telegram/SourceFiles/apiwrap.cpp | 69 +++++++++---------- Telegram/SourceFiles/apiwrap.h | 14 ++-- Telegram/SourceFiles/data/data_session.cpp | 22 +++--- Telegram/SourceFiles/data/data_session.h | 6 +- .../SourceFiles/dialogs/dialogs_entry.cpp | 8 +-- Telegram/SourceFiles/dialogs/dialogs_entry.h | 10 +-- .../SourceFiles/dialogs/dialogs_layout.cpp | 2 +- Telegram/SourceFiles/history/history.cpp | 8 +-- Telegram/SourceFiles/history/history.h | 2 +- .../SourceFiles/history/history_widget.cpp | 32 ++++----- Telegram/SourceFiles/history/history_widget.h | 4 +- Telegram/SourceFiles/main/main_session.cpp | 4 +- .../settings/settings_privacy_controllers.cpp | 3 +- .../SourceFiles/window/window_peer_menu.cpp | 2 +- 15 files changed, 98 insertions(+), 101 deletions(-) diff --git a/Telegram/Resources/tl/api.tl b/Telegram/Resources/tl/api.tl index 244f200316..f6d91c04a0 100644 --- a/Telegram/Resources/tl/api.tl +++ b/Telegram/Resources/tl/api.tl @@ -651,7 +651,7 @@ messages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_off exportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink; -messageFwdHeader#ec338270 flags:# from_id:flags.0?int from_name:flags.5?string date:int channel_id:flags.1?int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int = MessageFwdHeader; +messageFwdHeader#353a686b flags:# from_id:flags.0?int from_name:flags.5?string date:int channel_id:flags.1?int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader; auth.codeTypeSms#72a3158c = auth.CodeType; auth.codeTypeCall#741cd3e3 = auth.CodeType; @@ -912,9 +912,6 @@ fileHash#6242c773 offset:int limit:int hash:bytes = FileHash; inputClientProxy#75588b3f address:string port:int = InputClientProxy; -help.proxyDataEmpty#e09e1fb8 expires:int = help.ProxyData; -help.proxyDataPromo#2bf7ee23 expires:int peer:Peer chats:Vector users:Vector = help.ProxyData; - help.termsOfServiceUpdateEmpty#e3309f7f expires:int = help.TermsOfServiceUpdate; help.termsOfServiceUpdate#28ecf961 expires:int terms_of_service:help.TermsOfService = help.TermsOfServiceUpdate; @@ -1140,6 +1137,9 @@ messageInteractionCounters#ad4fc9bd msg_id:int views:int forwards:int = MessageI stats.broadcastStats#bdf78394 period:StatsDateRangeDays followers:StatsAbsValueAndPrev views_per_post:StatsAbsValueAndPrev shares_per_post: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 recent_message_interactions:Vector = stats.BroadcastStats; +help.promoDataEmpty#98f6ac75 expires:int = help.PromoData; +help.promoData#8f6adccf flags:# proxy:flags.0?true psa:flags.1?true expires:int peer:Peer chats:Vector users:Vector psa_message:flags.2?string = help.PromoData; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1411,7 +1411,6 @@ help.getAppChangelog#9010ef6f prev_app_version:string = Updates; help.setBotUpdatesStatus#ec22cfcd pending_updates_count:int message:string = Bool; help.getCdnConfig#52029342 = CdnConfig; help.getRecentMeUrls#3dc0f114 referer:string = help.RecentMeUrls; -help.getProxyData#3d7758e1 = help.ProxyData; help.getTermsOfServiceUpdate#2ca51fd1 = help.TermsOfServiceUpdate; help.acceptTermsOfService#ee72f79a id:DataJSON = Bool; help.getDeepLinkInfo#3fedc75f path:string = help.DeepLinkInfo; @@ -1421,6 +1420,7 @@ help.getPassportConfig#c661ad08 hash:int = help.PassportConfig; help.getSupportName#d360e72c = help.SupportName; help.getUserInfo#38a08d3 user_id:InputUser = help.UserInfo; help.editUserInfo#66b91b70 user_id:InputUser message:string entities:Vector = help.UserInfo; +help.getPromoData#c0977421 = help.PromoData; channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool; channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector = messages.AffectedMessages; @@ -1494,7 +1494,6 @@ langpack.getLanguage#6a596502 lang_pack:string lang_code:string = LangPackLangua folders.editPeerFolders#6847d0ab folder_peers:Vector = Updates; folders.deleteFolder#1c295881 folder_id:int = Updates; -stats.getBroadcastStats#e6300dba flags:# dark:flags.0?true channel:InputChannel tz_offset:int = stats.BroadcastStats; stats.loadAsyncGraph#621d5fa0 flags:# token:string x:flags.0?long = StatsGraph; -// LAYER 112 +// LAYER 113 diff --git a/Telegram/SourceFiles/apiwrap.cpp b/Telegram/SourceFiles/apiwrap.cpp index a06bd750bb..b44fb5f772 100644 --- a/Telegram/SourceFiles/apiwrap.cpp +++ b/Telegram/SourceFiles/apiwrap.cpp @@ -88,8 +88,8 @@ constexpr auto kMaxUsersPerInvite = 100; // that was added to this chat. constexpr auto kForwardMessagesOnAdd = 100; -constexpr auto kProxyPromotionInterval = TimeId(60 * 60); -constexpr auto kProxyPromotionMinDelay = TimeId(10); +constexpr auto kTopPromotionInterval = TimeId(60 * 60); +constexpr auto kTopPromotionMinDelay = TimeId(10); constexpr auto kSmallDelayMs = 5; constexpr auto kUnreadMentionsPreloadIfLess = 5; constexpr auto kUnreadMentionsFirstRequestLimit = 10; @@ -237,7 +237,7 @@ ApiWrap::ApiWrap(not_null session) , _dialogsLoadState(std::make_unique()) , _fileLoader(std::make_unique(kFileLoaderQueueStopTimeout)) //, _feedReadTimer([=] { readFeeds(); }) // #feed -, _proxyPromotionTimer([=] { refreshProxyPromotion(); }) +, _topPromotionTimer([=] { refreshTopPromotion(); }) , _updateNotifySettingsTimer([=] { sendNotifySettingsUpdates(); }) , _selfDestruct(std::make_unique(this)) , _sensitiveContent(std::make_unique(this)) { @@ -288,13 +288,13 @@ void ApiWrap::requestChangelog( ).send(); } -void ApiWrap::refreshProxyPromotion() { +void ApiWrap::refreshTopPromotion() { const auto now = base::unixtime::now(); - const auto next = (_proxyPromotionNextRequestTime != 0) - ? _proxyPromotionNextRequestTime + const auto next = (_topPromotionNextRequestTime != 0) + ? _topPromotionNextRequestTime : now; - if (_proxyPromotionRequestId) { - getProxyPromotionDelayed(now, next); + if (_topPromotionRequestId) { + getTopPromotionDelayed(now, next); return; } const auto key = [&]() -> std::pair { @@ -307,51 +307,48 @@ void ApiWrap::refreshProxyPromotion() { } return { proxy.host, proxy.port }; }(); - if (_proxyPromotionKey == key && now < next) { - getProxyPromotionDelayed(now, next); + if (_topPromotionKey == key && now < next) { + getTopPromotionDelayed(now, next); return; } - _proxyPromotionKey = key; - if (key.first.isEmpty() || !key.second) { - proxyPromotionDone(MTP_help_proxyDataEmpty( - MTP_int(base::unixtime::now() + kProxyPromotionInterval))); - return; - } - _proxyPromotionRequestId = request(MTPhelp_GetProxyData( - )).done([=](const MTPhelp_ProxyData &result) { - _proxyPromotionRequestId = 0; - proxyPromotionDone(result); + _topPromotionKey = key; + _topPromotionRequestId = request(MTPhelp_GetPromoData( + )).done([=](const MTPhelp_PromoData &result) { + _topPromotionRequestId = 0; + topPromotionDone(result); }).fail([=](const RPCError &error) { - _proxyPromotionRequestId = 0; + _topPromotionRequestId = 0; const auto now = base::unixtime::now(); - const auto next = _proxyPromotionNextRequestTime = now - + kProxyPromotionInterval; - if (!_proxyPromotionTimer.isActive()) { - getProxyPromotionDelayed(now, next); + const auto next = _topPromotionNextRequestTime = now + + kTopPromotionInterval; + if (!_topPromotionTimer.isActive()) { + getTopPromotionDelayed(now, next); } }).send(); } -void ApiWrap::getProxyPromotionDelayed(TimeId now, TimeId next) { - _proxyPromotionTimer.callOnce(std::min( - std::max(next - now, kProxyPromotionMinDelay), - kProxyPromotionInterval) * crl::time(1000)); +void ApiWrap::getTopPromotionDelayed(TimeId now, TimeId next) { + _topPromotionTimer.callOnce(std::min( + std::max(next - now, kTopPromotionMinDelay), + kTopPromotionInterval) * crl::time(1000)); }; -void ApiWrap::proxyPromotionDone(const MTPhelp_ProxyData &proxy) { - _proxyPromotionNextRequestTime = proxy.match([&](const auto &data) { +void ApiWrap::topPromotionDone(const MTPhelp_PromoData &proxy) { + _topPromotionNextRequestTime = proxy.match([&](const auto &data) { return data.vexpires().v; }); - getProxyPromotionDelayed(base::unixtime::now(), _proxyPromotionNextRequestTime); + getTopPromotionDelayed( + base::unixtime::now(), + _topPromotionNextRequestTime); - proxy.match([&](const MTPDhelp_proxyDataEmpty &data) { - _session->data().setProxyPromoted(nullptr); - }, [&](const MTPDhelp_proxyDataPromo &data) { + proxy.match([&](const MTPDhelp_promoDataEmpty &data) { + _session->data().setTopPromoted(nullptr); + }, [&](const MTPDhelp_promoData &data) { _session->data().processChats(data.vchats()); _session->data().processUsers(data.vusers()); const auto peerId = peerFromMTP(data.vpeer()); const auto peer = _session->data().peer(peerId); - _session->data().setProxyPromoted(peer); + _session->data().setTopPromoted(peer); if (const auto history = _session->data().historyLoaded(peer)) { history->owner().histories().requestDialogEntry(history); } diff --git a/Telegram/SourceFiles/apiwrap.h b/Telegram/SourceFiles/apiwrap.h index 30d364dbd3..eb4015625f 100644 --- a/Telegram/SourceFiles/apiwrap.h +++ b/Telegram/SourceFiles/apiwrap.h @@ -208,7 +208,7 @@ public: void requestChangelog( const QString &sinceVersion, Fn callback); - void refreshProxyPromotion(); + void refreshTopPromotion(); void requestDeepLinkInfo( const QString &path, Fn callback); @@ -646,8 +646,8 @@ private: //void readFeeds(); // #feed - void getProxyPromotionDelayed(TimeId now, TimeId next); - void proxyPromotionDone(const MTPhelp_ProxyData &proxy); + void getTopPromotionDelayed(TimeId now, TimeId next); + void topPromotionDone(const MTPhelp_PromoData &proxy); void sendNotifySettingsUpdates(); @@ -787,10 +787,10 @@ private: //base::flat_map, mtpRequestId> _feedReadRequests; //base::Timer _feedReadTimer; - mtpRequestId _proxyPromotionRequestId = 0; - std::pair _proxyPromotionKey; - TimeId _proxyPromotionNextRequestTime = TimeId(0); - base::Timer _proxyPromotionTimer; + mtpRequestId _topPromotionRequestId = 0; + std::pair _topPromotionKey; + TimeId _topPromotionNextRequestTime = TimeId(0); + base::Timer _topPromotionTimer; base::flat_set> _updateNotifySettingsPeers; base::Timer _updateNotifySettingsTimer; diff --git a/Telegram/SourceFiles/data/data_session.cpp b/Telegram/SourceFiles/data/data_session.cpp index 43e5298152..fd7ccb5e96 100644 --- a/Telegram/SourceFiles/data/data_session.cpp +++ b/Telegram/SourceFiles/data/data_session.cpp @@ -3713,18 +3713,18 @@ MessageIdsList Session::takeMimeForwardIds() { return std::move(_mimeForwardIds); } -void Session::setProxyPromoted(PeerData *promoted) { - if (_proxyPromoted != promoted) { - if (const auto history = historyLoaded(_proxyPromoted)) { - history->cacheProxyPromoted(false); +void Session::setTopPromoted(PeerData *promoted) { + if (_topPromoted != promoted) { + if (const auto history = historyLoaded(_topPromoted)) { + history->cacheTopPromoted(false); } - const auto old = std::exchange(_proxyPromoted, promoted); - if (_proxyPromoted) { - const auto history = this->history(_proxyPromoted); - history->cacheProxyPromoted(true); + const auto old = std::exchange(_topPromoted, promoted); + if (_topPromoted) { + const auto history = this->history(_topPromoted); + history->cacheTopPromoted(true); history->requestChatListMessage(); Notify::peerUpdatedDelayed( - _proxyPromoted, + _topPromoted, Notify::PeerUpdate::Flag::ChannelPromotedChanged); } if (old) { @@ -3735,8 +3735,8 @@ void Session::setProxyPromoted(PeerData *promoted) { } } -PeerData *Session::proxyPromoted() const { - return _proxyPromoted; +PeerData *Session::topPromoted() const { + return _topPromoted; } bool Session::updateWallpapers(const MTPaccount_WallPapers &data) { diff --git a/Telegram/SourceFiles/data/data_session.h b/Telegram/SourceFiles/data/data_session.h index 0b591b3c36..a43a969470 100644 --- a/Telegram/SourceFiles/data/data_session.h +++ b/Telegram/SourceFiles/data/data_session.h @@ -678,8 +678,8 @@ public: void setMimeForwardIds(MessageIdsList &&list); MessageIdsList takeMimeForwardIds(); - void setProxyPromoted(PeerData *promoted); - PeerData *proxyPromoted() const; + void setTopPromoted(PeerData *promoted); + PeerData *topPromoted() const; bool updateWallpapers(const MTPaccount_WallPapers &data); void removeWallpaper(const WallPaper &paper); @@ -957,7 +957,7 @@ private: base::flat_set> _heavyViewParts; - PeerData *_proxyPromoted = nullptr; + PeerData *_topPromoted = nullptr; NotifySettings _defaultUserNotifySettings; NotifySettings _defaultChatNotifySettings; diff --git a/Telegram/SourceFiles/dialogs/dialogs_entry.cpp b/Telegram/SourceFiles/dialogs/dialogs_entry.cpp index f707b99287..4359237ec9 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_entry.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_entry.cpp @@ -86,12 +86,12 @@ void Entry::cachePinnedIndex(FilterId filterId, int index) { } } -void Entry::cacheProxyPromoted(bool promoted) { - if (_isProxyPromoted != promoted) { - _isProxyPromoted = promoted; +void Entry::cacheTopPromoted(bool promoted) { + if (_isTopPromoted != promoted) { + _isTopPromoted = promoted; updateChatListSortPosition(); updateChatListEntry(); - if (!_isProxyPromoted) { + if (!_isTopPromoted) { updateChatListExistence(); } } diff --git a/Telegram/SourceFiles/dialogs/dialogs_entry.h b/Telegram/SourceFiles/dialogs/dialogs_entry.h index b9e21a3694..2191065521 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_entry.h +++ b/Telegram/SourceFiles/dialogs/dialogs_entry.h @@ -120,10 +120,10 @@ public: return lookupPinnedIndex(filterId) != 0; } void cachePinnedIndex(FilterId filterId, int index); - bool isProxyPromoted() const { - return _isProxyPromoted; + bool isTopPromoted() const { + return _isTopPromoted; } - void cacheProxyPromoted(bool promoted); + void cacheTopPromoted(bool promoted); [[nodiscard]] uint64 sortKeyInChatList(FilterId filterId) const { return filterId ? computeSortPosition(filterId) @@ -137,7 +137,7 @@ public: virtual int fixedOnTopIndex() const = 0; static constexpr auto kArchiveFixOnTopIndex = 1; - static constexpr auto kProxyPromotionFixOnTopIndex = 2; + static constexpr auto kTopPromotionFixOnTopIndex = 2; virtual bool shouldBeInChatList() const = 0; virtual int chatListUnreadCount() const = 0; @@ -211,7 +211,7 @@ private: uint64 _sortKeyInChatList = 0; uint64 _sortKeyByDate = 0; base::flat_map _pinnedIndex; - bool _isProxyPromoted = false; + bool _isTopPromoted = false; TimeId _timeId = 0; }; diff --git a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp index f5e681e257..861c5cebba 100644 --- a/Telegram/SourceFiles/dialogs/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/dialogs_layout.cpp @@ -296,7 +296,7 @@ void paintRow( namewidth, st::msgNameFont->height); - const auto promoted = (history && history->useProxyPromotion()) + const auto promoted = (history && history->useTopPromotion()) && !(flags & (Flag::SearchResult/* | Flag::FeedSearchResult*/)); // #feed if (promoted) { const auto text = tr::lng_proxy_sponsor(tr::now); diff --git a/Telegram/SourceFiles/history/history.cpp b/Telegram/SourceFiles/history/history.cpp index e613e6ab2a..4594cea06b 100644 --- a/Telegram/SourceFiles/history/history.cpp +++ b/Telegram/SourceFiles/history/history.cpp @@ -2580,8 +2580,8 @@ void History::updateChatListExistence() { //} } -bool History::useProxyPromotion() const { - if (!isProxyPromoted()) { +bool History::useTopPromotion() const { + if (!isTopPromoted()) { return false; } else if (const auto channel = peer->asChannel()) { return !isPinnedDialog(FilterId()) && !channel->amIn(); @@ -2590,7 +2590,7 @@ bool History::useProxyPromotion() const { } int History::fixedOnTopIndex() const { - return useProxyPromotion() ? kProxyPromotionFixOnTopIndex : 0; + return useTopPromotion() ? kTopPromotionFixOnTopIndex : 0; } bool History::trackUnreadMessages() const { @@ -2607,7 +2607,7 @@ bool History::shouldBeInChatList() const { return true; } else if (const auto channel = peer->asChannel()) { if (!channel->amIn()) { - return isProxyPromoted(); + return isTopPromoted(); //} else if (const auto feed = channel->feed()) { // #feed // return !feed->needUpdateInChatList(); } diff --git a/Telegram/SourceFiles/history/history.h b/Telegram/SourceFiles/history/history.h index c41087a92a..265b0eb680 100644 --- a/Telegram/SourceFiles/history/history.h +++ b/Telegram/SourceFiles/history/history.h @@ -330,7 +330,7 @@ public: void setForwardDraft(MessageIdsList &&items); History *migrateSibling() const; - bool useProxyPromotion() const; + bool useTopPromotion() const; int fixedOnTopIndex() const override; void updateChatListExistence() override; bool shouldBeInChatList() const override; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index e6eaef39f1..b59eddc9d9 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -564,7 +564,7 @@ HistoryWidget::HistoryWidget( } } if (update.flags & UpdateFlag::ChannelPromotedChanged) { - refreshAboutProxyPromotion(); + refreshAboutTopPromotion(); updateHistoryGeometry(); updateControlsVisibility(); updateControlsGeometry(); @@ -2067,7 +2067,7 @@ void HistoryWidget::updateControlsVisibility() { if (_contactStatus) { _contactStatus->show(); } - refreshAboutProxyPromotion(); + refreshAboutTopPromotion(); if (!editingMessage() && (isBlocked() || isJoinChannel() || isMuteUnmute() || isBotStart())) { if (isBlocked()) { _joinChannel->hide(); @@ -2260,10 +2260,10 @@ void HistoryWidget::updateControlsVisibility() { updateMouseTracking(); } -void HistoryWidget::refreshAboutProxyPromotion() { - if (_history->useProxyPromotion()) { - if (!_aboutProxyPromotion) { - _aboutProxyPromotion = object_ptr>( +void HistoryWidget::refreshAboutTopPromotion() { + if (_history->useTopPromotion()) { + if (!_aboutTopPromotion) { + _aboutTopPromotion = object_ptr>( this, object_ptr( this, @@ -2271,9 +2271,9 @@ void HistoryWidget::refreshAboutProxyPromotion() { st::historyAboutProxy), st::historyAboutProxyPadding); } - _aboutProxyPromotion->show(); + _aboutTopPromotion->show(); } else { - _aboutProxyPromotion.destroy(); + _aboutTopPromotion.destroy(); } } @@ -4188,10 +4188,10 @@ void HistoryWidget::moveFieldControls() { _muteUnmute->setGeometry(fullWidthButtonRect); } - if (_aboutProxyPromotion) { - _aboutProxyPromotion->moveToLeft( + if (_aboutTopPromotion) { + _aboutTopPromotion->moveToLeft( 0, - fullWidthButtonRect.y() - _aboutProxyPromotion->height()); + fullWidthButtonRect.y() - _aboutTopPromotion->height()); } } @@ -5197,9 +5197,9 @@ void HistoryWidget::updateHistoryGeometry( } if (!editingMessage() && (isBlocked() || isBotStart() || isJoinChannel() || isMuteUnmute())) { newScrollHeight -= _unblock->height(); - if (_aboutProxyPromotion) { - _aboutProxyPromotion->resizeToWidth(width()); - newScrollHeight -= _aboutProxyPromotion->height(); + if (_aboutTopPromotion) { + _aboutTopPromotion->resizeToWidth(width()); + newScrollHeight -= _aboutTopPromotion->height(); } } else { if (editingMessage() || _canSendMessages) { @@ -6983,8 +6983,8 @@ void HistoryWidget::paintEvent(QPaintEvent *e) { } else if (const auto error = writeRestriction()) { drawRestrictedWrite(p, *error); } - if (_aboutProxyPromotion) { - p.fillRect(_aboutProxyPromotion->geometry(), st::historyReplyBg); + if (_aboutTopPromotion) { + p.fillRect(_aboutTopPromotion->geometry(), st::historyReplyBg); } if (_pinnedBar && !_pinnedBar->cancel->isHidden()) { drawPinnedBar(p); diff --git a/Telegram/SourceFiles/history/history_widget.h b/Telegram/SourceFiles/history/history_widget.h index 3b6ccafa25..ace45e25b0 100644 --- a/Telegram/SourceFiles/history/history_widget.h +++ b/Telegram/SourceFiles/history/history_widget.h @@ -380,7 +380,7 @@ private: void handlePeerUpdate(); void setMembersShowAreaActive(bool active); void handleHistoryChange(not_null history); - void refreshAboutProxyPromotion(); + void refreshAboutTopPromotion(); void unreadCountUpdated(); [[nodiscard]] int computeMaxFieldHeight() const; @@ -734,7 +734,7 @@ private: object_ptr _joinChannel; object_ptr _muteUnmute; object_ptr _discuss; - object_ptr _aboutProxyPromotion = { nullptr }; + object_ptr _aboutTopPromotion = { nullptr }; object_ptr _attachToggle; object_ptr _tabbedSelectorToggle; object_ptr _botKeyboardShow; diff --git a/Telegram/SourceFiles/main/main_session.cpp b/Telegram/SourceFiles/main/main_session.cpp index 9332f678b6..6a1b1538a8 100644 --- a/Telegram/SourceFiles/main/main_session.cpp +++ b/Telegram/SourceFiles/main/main_session.cpp @@ -69,9 +69,9 @@ Session::Session( notifications().updateAll(); }, _lifetime); subscribe(Global::RefConnectionTypeChanged(), [=] { - _api->refreshProxyPromotion(); + _api->refreshTopPromotion(); }); - _api->refreshProxyPromotion(); + _api->refreshTopPromotion(); _api->requestTermsUpdate(); _api->requestFullPeer(_user); diff --git a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp index 9954ca90e6..e6bcd6ab53 100644 --- a/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp +++ b/Telegram/SourceFiles/settings/settings_privacy_controllers.cpp @@ -150,7 +150,8 @@ AdminLog::OwnedItem GenerateForwardedItem( MTPint(), // channel_post MTPstring(), // post_author MTPPeer(), // saved_from_peer - MTPint()), // saved_from_msg_id + MTPint(), // saved_from_msg_id + MTPstring()), // psa_type MTPint(), // via_bot_id MTPint(), // reply_to_msg_id, MTP_int(base::unixtime::now()), // date diff --git a/Telegram/SourceFiles/window/window_peer_menu.cpp b/Telegram/SourceFiles/window/window_peer_menu.cpp index 7505886253..be88faf175 100644 --- a/Telegram/SourceFiles/window/window_peer_menu.cpp +++ b/Telegram/SourceFiles/window/window_peer_menu.cpp @@ -253,7 +253,7 @@ bool Filler::showToggleArchived() { return false; } const auto history = _peer->owner().historyLoaded(_peer); - if (history && history->useProxyPromotion()) { + if (history && history->useTopPromotion()) { return false; } else if (!_peer->isNotificationsUser() && !_peer->isSelf()) { return true;