mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-28 10:55:40 +00:00
Fixed voice messages autodownload
This commit is contained in:
parent
9e57955cfb
commit
c67619116b
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user