From c67619116b5920df38c7ff9c6559febaaffcdae6 Mon Sep 17 00:00:00 2001 From: Ilya Laktyushin Date: Wed, 12 Jun 2019 18:02:12 +0200 Subject: [PATCH] Fixed voice messages autodownload --- .../TelegramUI/TelegramUI/MediaAutoDownloadSettings.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/submodules/TelegramUI/TelegramUI/MediaAutoDownloadSettings.swift b/submodules/TelegramUI/TelegramUI/MediaAutoDownloadSettings.swift index 541cd06a11..28aac5feaa 100644 --- a/submodules/TelegramUI/TelegramUI/MediaAutoDownloadSettings.swift +++ b/submodules/TelegramUI/TelegramUI/MediaAutoDownloadSettings.swift @@ -337,13 +337,12 @@ public func shouldDownloadMediaAutomatically(settings: MediaAutoDownloadSettings } if let (category, size) = categoryAndSizeForMedia(media, categories: effectiveAutodownloadCategories(settings: settings, networkType: networkType)) { - guard isAutodownloadEnabledForPeerType(peerType, category: category) else { - return false - } if let size = size { var sizeLimit = category.sizeLimit if let file = media as? TelegramMediaFile, file.isVoice { sizeLimit = max(2 * 1024 * 1024, sizeLimit) + } else if !isAutodownloadEnabledForPeerType(peerType, category: category) { + return false } return size <= sizeLimit } else if category.sizeLimit == Int32.max {