parent
0018d0040b
commit
193d9421ce
|
@ -2182,8 +2182,8 @@ typedef enum : NSUInteger {
|
|||
|
||||
NSURL *referenceURL = [info valueForKey:UIImagePickerControllerReferenceURL];
|
||||
if (!referenceURL) {
|
||||
DDLogError(@"Could not retrieve reference URL for picked asset");
|
||||
OWSAssert(0);
|
||||
DDLogVerbose(@"Could not retrieve reference URL for picked asset");
|
||||
[self imagePickerController:picker didFinishPickingMediaWithInfo:info filename:nil];
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2357,24 +2357,25 @@ typedef enum : NSUInteger {
|
|||
exportSession.outputURL = compressedVideoUrl;
|
||||
[exportSession exportAsynchronouslyWithCompletionHandler:^{
|
||||
NSData *videoData = [NSData dataWithContentsOfURL:compressedVideoUrl];
|
||||
SignalAttachment *attachment =
|
||||
[SignalAttachment videoAttachmentWithData:videoData dataUTI:(NSString *)kUTTypeMPEG4 filename:filename];
|
||||
if (!attachment ||
|
||||
[attachment hasError]) {
|
||||
DDLogWarn(@"%@ %s Invalid attachment: %@.",
|
||||
self.tag,
|
||||
__PRETTY_FUNCTION__,
|
||||
attachment ? [attachment errorName] : @"Missing data");
|
||||
[self showErrorAlertForAttachment:attachment];
|
||||
} else {
|
||||
[self tryToSendAttachmentIfApproved:attachment];
|
||||
}
|
||||
|
||||
NSError *error;
|
||||
[[NSFileManager defaultManager] removeItemAtURL:compressedVideoUrl error:&error];
|
||||
if (error) {
|
||||
DDLogWarn(@"Failed to remove cached video file: %@", error.debugDescription);
|
||||
}
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
SignalAttachment *attachment =
|
||||
[SignalAttachment videoAttachmentWithData:videoData dataUTI:(NSString *)kUTTypeMPEG4 filename:filename];
|
||||
if (!attachment || [attachment hasError]) {
|
||||
DDLogWarn(@"%@ %s Invalid attachment: %@.",
|
||||
self.tag,
|
||||
__PRETTY_FUNCTION__,
|
||||
attachment ? [attachment errorName] : @"Missing data");
|
||||
[self showErrorAlertForAttachment:attachment];
|
||||
} else {
|
||||
[self tryToSendAttachmentIfApproved:attachment];
|
||||
}
|
||||
|
||||
NSError *error;
|
||||
[[NSFileManager defaultManager] removeItemAtURL:compressedVideoUrl error:&error];
|
||||
if (error) {
|
||||
DDLogWarn(@"Failed to remove cached video file: %@", error.debugDescription);
|
||||
}
|
||||
});
|
||||
}];
|
||||
}
|
||||
|
||||
|
|
|
@ -317,6 +317,7 @@ static NSString *const kUnwindToMessagesViewSegue = @"UnwindToMessagesViewSegue"
|
|||
if (model.groupImage) {
|
||||
[self.messageSender sendAttachmentData:UIImagePNGRepresentation(model.groupImage)
|
||||
contentType:OWSMimeTypeImagePng
|
||||
filename:nil
|
||||
inMessage:message
|
||||
success:popToThread
|
||||
failure:removeThreadWithError];
|
||||
|
|
|
@ -302,7 +302,7 @@ class SignalAttachment: NSObject {
|
|||
assertionFailure()
|
||||
return nil
|
||||
}
|
||||
return genericAttachment(data : data, dataUTI : dataUTI)
|
||||
return genericAttachment(data : data, dataUTI : dataUTI, filename: nil)
|
||||
}
|
||||
|
||||
// This method should only be called for dataUTIs that
|
||||
|
|
Loading…
Reference in New Issue