mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-28 19:05:49 +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)) {
|
if let (category, size) = categoryAndSizeForMedia(media, categories: effectiveAutodownloadCategories(settings: settings, networkType: networkType)) {
|
||||||
guard isAutodownloadEnabledForPeerType(peerType, category: category) else {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
if let size = size {
|
if let size = size {
|
||||||
var sizeLimit = category.sizeLimit
|
var sizeLimit = category.sizeLimit
|
||||||
if let file = media as? TelegramMediaFile, file.isVoice {
|
if let file = media as? TelegramMediaFile, file.isVoice {
|
||||||
sizeLimit = max(2 * 1024 * 1024, sizeLimit)
|
sizeLimit = max(2 * 1024 * 1024, sizeLimit)
|
||||||
|
} else if !isAutodownloadEnabledForPeerType(peerType, category: category) {
|
||||||
|
return false
|
||||||
}
|
}
|
||||||
return size <= sizeLimit
|
return size <= sizeLimit
|
||||||
} else if category.sizeLimit == Int32.max {
|
} else if category.sizeLimit == Int32.max {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user