Fixed GIFs not respecting autoplay preference

This commit is contained in:
Ilya Laktyushin 2019-07-11 02:41:06 +02:00
parent 18b0517ca0
commit c5cb691f2b

View File

@ -81,13 +81,13 @@ class ChatMessageMediaBubbleContentNode: ChatMessageBubbleContentNode {
} }
if !item.message.containsSecretMedia { if !item.message.containsSecretMedia {
if telegramFile.isAnimated { if telegramFile.isAnimated && item.controllerInteraction.automaticMediaDownloadSettings.autoplayGifs {
if case .full = automaticDownload { if case .full = automaticDownload {
automaticPlayback = item.controllerInteraction.automaticMediaDownloadSettings.autoplayGifs automaticPlayback = true //item.controllerInteraction.automaticMediaDownloadSettings.autoplayGifs
} else { } else {
automaticPlayback = item.context.account.postbox.mediaBox.completedResourcePath(telegramFile.resource) != nil automaticPlayback = item.context.account.postbox.mediaBox.completedResourcePath(telegramFile.resource) != nil
} }
} else if telegramFile.isVideo && item.controllerInteraction.automaticMediaDownloadSettings.autoplayVideos { } else if (telegramFile.isVideo && !telegramFile.isAnimated) && item.controllerInteraction.automaticMediaDownloadSettings.autoplayVideos {
if case .full = automaticDownload { if case .full = automaticDownload {
automaticPlayback = true automaticPlayback = true
} else { } else {