From 90df86ba7ac4ce89a8ae1603e4cb2ed839dc696f Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Wed, 27 Jan 2021 11:34:48 -0300 Subject: [PATCH] Protect oversize text messages from auto-download settings. --- .../src/Messages/Attachments/OWSAttachmentDownloads.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/SignalServiceKit/src/Messages/Attachments/OWSAttachmentDownloads.swift b/SignalServiceKit/src/Messages/Attachments/OWSAttachmentDownloads.swift index 9e7170dcf9..485c2037ef 100644 --- a/SignalServiceKit/src/Messages/Attachments/OWSAttachmentDownloads.swift +++ b/SignalServiceKit/src/Messages/Attachments/OWSAttachmentDownloads.swift @@ -313,7 +313,7 @@ public class OWSAttachmentDownloads: NSObject { switch job.category { case .bodyMediaImage, .bodyMediaVideo: break - case .bodyAudioVoiceMemo: + case .bodyAudioVoiceMemo, .bodyOversizeText: return false case .bodyAudioOther, .bodyFile: break @@ -388,7 +388,7 @@ public class OWSAttachmentDownloads: NSObject { return !autoDownloadableMediaTypes.contains(.photo) case .bodyMediaVideo: return !autoDownloadableMediaTypes.contains(.video) - case .bodyAudioVoiceMemo: + case .bodyAudioVoiceMemo, .bodyOversizeText: return false case .bodyAudioOther: return !autoDownloadableMediaTypes.contains(.audio) @@ -811,6 +811,7 @@ public extension OWSAttachmentDownloads { case bodyAudioVoiceMemo case bodyAudioOther case bodyFile + case bodyOversizeText case stickerSmall case stickerLarge case quotedReplyThumbnail @@ -874,6 +875,8 @@ public extension OWSAttachmentDownloads { return .bodyAudioVoiceMemo } else if attachment.isAudio { return .bodyAudioOther + } else if attachment.isOversizeText { + return .bodyOversizeText } else { return .bodyFile }