Fix Chat List: Copyrighted chats are not shown (#999)

This commit is contained in:
Alexander Zinchuk 2021-04-15 13:16:43 +03:00
parent 2c27e16f0d
commit 580bca90e2

View File

@ -121,9 +121,13 @@ function buildApiChatRestrictions(peerEntity: GramJs.TypeUser | GramJs.TypeChat)
isRestricted: peerEntity.kicked, isRestricted: peerEntity.kicked,
}; };
} else if (peerEntity instanceof GramJs.Channel) { } else if (peerEntity instanceof GramJs.Channel) {
const isRestricted = peerEntity.restricted
&& peerEntity.restrictionReason
&& peerEntity.restrictionReason.some((reason) => reason.platform === 'all');
return { return {
isNotJoined: peerEntity.left, isNotJoined: peerEntity.left,
isRestricted: peerEntity.restricted, isRestricted,
restrictionReason: buildApiChatRestrictionReason(peerEntity.restrictionReason), restrictionReason: buildApiChatRestrictionReason(peerEntity.restrictionReason),
}; };
} }