diff --git a/Telegram/SourceFiles/data/data_community.cpp b/Telegram/SourceFiles/data/data_community.cpp index 295e4ed893..5652f81718 100644 --- a/Telegram/SourceFiles/data/data_community.cpp +++ b/Telegram/SourceFiles/data/data_community.cpp @@ -92,7 +92,7 @@ constexpr auto kShowChatNamesCount = 20; } // namespace bool IsCommunityChatViewable(const CommunityLinkedPeer &linked) { - return (linked.visible == true); + return linked.canViewHistory; } CommunityInfo::CommunityInfo(not_null channel) @@ -129,6 +129,7 @@ void CommunityInfo::applyLinkedPeers(const QVector &list) { now.push_back({ .peer = owner.peer(peerFromMTP(data.vpeer())), .visible = visible, + .canViewHistory = data.is_can_view_history(), }); } if (_linkedPeers == now) { diff --git a/Telegram/SourceFiles/data/data_community.h b/Telegram/SourceFiles/data/data_community.h index 623ea7cbac..37e274a0f7 100644 --- a/Telegram/SourceFiles/data/data_community.h +++ b/Telegram/SourceFiles/data/data_community.h @@ -19,6 +19,7 @@ namespace Data { struct CommunityLinkedPeer { not_null peer; std::optional visible; + bool canViewHistory = false; friend inline bool operator==( const CommunityLinkedPeer &, diff --git a/Telegram/SourceFiles/mtproto/scheme/api.tl b/Telegram/SourceFiles/mtproto/scheme/api.tl index 16b359c051..114cb324b2 100644 --- a/Telegram/SourceFiles/mtproto/scheme/api.tl +++ b/Telegram/SourceFiles/mtproto/scheme/api.tl @@ -2234,7 +2234,7 @@ inputRichMessageMarkdown#4b572c flags:# rtl:flags.0?true noautolink:flags.1?true richMessage#baf39d8b flags:# rtl:flags.0?true part:flags.1?true blocks:Vector photos:Vector documents:Vector = RichMessage; -communityPeer#76141ebd flags:# visible:flags.0?Bool peer:Peer = CommunityPeer; +communityPeer#76141ebd flags:# can_view_history:flags.2?true visible:flags.0?Bool peer:Peer = CommunityPeer; communityPeerRequest#7beafa85 flags:# visible:flags.0?true peer:Peer requested_by:long date:int = CommunityPeerRequest;