diff --git a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m index ddfa18d34..be855291b 100644 --- a/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m +++ b/Signal/src/ViewControllers/ConversationView/ConversationViewItem.m @@ -481,6 +481,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType) if (message.attachmentIds.count == 0) { return nil; } + // TODO: Support multi-image messages. NSString *_Nullable attachmentId = message.attachmentIds.firstObject; if (attachmentId.length == 0) { return nil; diff --git a/Signal/src/ViewControllers/MessageDetailViewController.swift b/Signal/src/ViewControllers/MessageDetailViewController.swift index 005f9a426..d026a050f 100644 --- a/Signal/src/ViewControllers/MessageDetailViewController.swift +++ b/Signal/src/ViewControllers/MessageDetailViewController.swift @@ -398,6 +398,7 @@ class MessageDetailViewController: OWSViewController, MediaGalleryDataSourceDele } private func fetchAttachment(transaction: YapDatabaseReadTransaction) -> TSAttachment? { + // TODO: Support multi-image messages. guard let attachmentId = message.attachmentIds.firstObject as? String else { return nil } diff --git a/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m b/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m index 1ba5c8189..f4fcb51a6 100644 --- a/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m +++ b/SignalMessaging/ViewControllers/SharingThreadPickerViewController.m @@ -579,6 +579,7 @@ typedef void (^SendMessageBlock)(SendCompletionBlock completion); return; } + // TODO: Support multi-image messages. NSString *_Nullable attachmentRecordId = self.outgoingMessage.attachmentIds.firstObject; if (!attachmentRecordId) { OWSLogDebug(@"Ignoring upload progress until outgoing message has an attachment record id"); diff --git a/SignalServiceKit/src/Messages/OWSMessageSender.m b/SignalServiceKit/src/Messages/OWSMessageSender.m index 9edc3a6a9..613bc1407 100644 --- a/SignalServiceKit/src/Messages/OWSMessageSender.m +++ b/SignalServiceKit/src/Messages/OWSMessageSender.m @@ -376,11 +376,10 @@ NSString *const OWSMessageSenderRateLimitedException = @"RateLimitedException"; success:successHandler failure:failureHandler]; - // TODO de-dupe attachment enque logic. - if (message.hasAttachments) { + // TODO: de-dupe attachment enqueue logic. + for (NSString *attachmentId in message.attachmentIds) { OWSUploadOperation *uploadAttachmentOperation = - [[OWSUploadOperation alloc] initWithAttachmentId:message.attachmentIds.firstObject - dbConnection:self.dbConnection]; + [[OWSUploadOperation alloc] initWithAttachmentId:attachmentId dbConnection:self.dbConnection]; [sendMessageOperation addDependency:uploadAttachmentOperation]; [sendingQueue addOperation:uploadAttachmentOperation]; } diff --git a/SignalShareExtension/ShareViewController.swift b/SignalShareExtension/ShareViewController.swift index 38c42875e..7dbe23962 100644 --- a/SignalShareExtension/ShareViewController.swift +++ b/SignalShareExtension/ShareViewController.swift @@ -609,6 +609,7 @@ public class ShareViewController: UIViewController, ShareViewDelegate, SAEFailed } // Prefer a URL provider if available + // TODO: Support multi-image messages. if let preferredAttachment = attachments.first(where: { (attachment: Any) -> Bool in guard let itemProvider = attachment as? NSItemProvider else { return false