Open all document images in an external preview

This commit is contained in:
Peter 2019-07-26 15:07:59 +01:00
parent 692ed2844e
commit 443d0a0d95

View File

@ -111,7 +111,7 @@ private func chatMessageGalleryControllerData(context: AccountContext, message:
} else if let galleryMedia = galleryMedia { } else if let galleryMedia = galleryMedia {
if let mapMedia = galleryMedia as? TelegramMediaMap { if let mapMedia = galleryMedia as? TelegramMediaMap {
return .map(mapMedia) return .map(mapMedia)
} else if let file = galleryMedia as? TelegramMediaFile, file.isSticker { } else if let file = galleryMedia as? TelegramMediaFile, (file.isSticker || file.isAnimatedSticker) {
for attribute in file.attributes { for attribute in file.attributes {
if case let .Sticker(_, reference, _) = attribute { if case let .Sticker(_, reference, _) = attribute {
if let reference = reference { if let reference = reference {
@ -153,7 +153,7 @@ private func chatMessageGalleryControllerData(context: AccountContext, message:
#endif #endif
} }
if !file.isVideo, !internalDocumentItemSupportsMimeType(file.mimeType, fileName: file.fileName) { if !file.isVideo {
return .document(file) return .document(file)
} }
} }