Only allow animated stickers from packs

This commit is contained in:
Ali
2020-09-14 19:04:45 +04:00
parent 455bbac924
commit c368f569ee

View File

@@ -351,7 +351,14 @@ public final class ChatMessageItem: ListViewItem, CustomStringConvertible {
if telegramFile.isAnimatedSticker, (self.message.id.peerId.namespace == Namespaces.Peer.SecretChat || !telegramFile.previewRepresentations.isEmpty), let size = telegramFile.size, size > 0 && size <= 128 * 1024 {
if self.message.id.peerId.namespace == Namespaces.Peer.SecretChat {
if telegramFile.fileId.namespace == Namespaces.Media.CloudFile {
viewClassName = ChatMessageAnimatedStickerItemNode.self
inner: for attribute in telegramFile.attributes {
if case let .Sticker(_, packReference, _) = attribute {
if case .name = packReference {
viewClassName = ChatMessageAnimatedStickerItemNode.self
}
break inner
}
}
}
} else {
viewClassName = ChatMessageAnimatedStickerItemNode.self