diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m index 48e6936f3..c1e879fea 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewController.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewController.m @@ -2483,6 +2483,14 @@ typedef NS_ENUM(NSInteger, MessagesRangeSizeMode) { } [dataSource setSourceFilename:filename]; + + // Although we want to be able to send higher quality attachments throught the document picker + // it's more imporant that we ensure the sent format is one all clients can accept (e.g. *not* quicktime .mov) + if ([SignalAttachment isInvalidVideoWithDataSource:dataSource dataUTI:type]) { + [self sendQualityAdjustedAttachmentForVideo:url filename:filename skipApprovalDialog:NO]; + return; + } + // "Document picker" attachments _SHOULD NOT_ be resized, if possible. SignalAttachment *attachment = [SignalAttachment attachmentWithDataSource:dataSource dataUTI:type imageQuality:TSImageQualityOriginal]; diff --git a/SignalMessaging/attachments/SignalAttachment.swift b/SignalMessaging/attachments/SignalAttachment.swift index c9758defc..bab8fb4bb 100644 --- a/SignalMessaging/attachments/SignalAttachment.swift +++ b/SignalMessaging/attachments/SignalAttachment.swift @@ -789,9 +789,6 @@ public class SignalAttachment: NSObject { } if !isInputVideoValidOutputVideo(dataSource: dataSource, dataUTI: dataUTI) { - // Most people won't hit this because we convert video when picked from the media picker - // But the current API allows sending videos that some Signal clients will not - // be able to view. (e.g. when picked from document picker) owsFail("building video with invalid output, migrate to async API using compressVideoAsMp4") }