From 580bca90e29cda895fa66cb8719992a86fecd07c Mon Sep 17 00:00:00 2001 From: Alexander Zinchuk Date: Thu, 15 Apr 2021 13:16:43 +0300 Subject: [PATCH] Fix Chat List: Copyrighted chats are not shown (#999) --- src/api/gramjs/apiBuilders/chats.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/api/gramjs/apiBuilders/chats.ts b/src/api/gramjs/apiBuilders/chats.ts index dcc57f3d6..92a0e49c9 100644 --- a/src/api/gramjs/apiBuilders/chats.ts +++ b/src/api/gramjs/apiBuilders/chats.ts @@ -121,9 +121,13 @@ function buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat) isRestricted: peerEntity.kicked, }; } else if (peerEntity instanceof GramJs.Channel) { + const isRestricted = peerEntity.restricted + && peerEntity.restrictionReason + && peerEntity.restrictionReason.some((reason) => reason.platform === 'all'); + return { isNotJoined: peerEntity.left, - isRestricted: peerEntity.restricted, + isRestricted, restrictionReason: buildApiChatRestrictionReason(peerEntity.restrictionReason), }; }