Add debug UI for multi-image sends.

This commit is contained in:
Matthew Chen 2018-11-02 11:37:35 -04:00
parent f6591fac25
commit ecba67b511
5 changed files with 7 additions and 4 deletions

View File

@ -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;

View File

@ -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
}

View File

@ -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");

View File

@ -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];
}

View File

@ -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