Rename to media album.

pull/1/head
Matthew Chen 7 years ago
parent 6a3ecb3d07
commit c1a5e1e258

@ -429,7 +429,7 @@ private class MockConversationViewItem: NSObject, ConversationViewItem {
return 2 return 2
} }
func firstValidGalleryAttachment() -> TSAttachmentStream? { func firstValidAlbumAttachment() -> TSAttachmentStream? {
owsFailDebug("unexpected invocation") owsFailDebug("unexpected invocation")
return nil return nil
} }

@ -241,7 +241,7 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
case OWSMessageCellType_ContactShare: case OWSMessageCellType_ContactShare:
return NO; return NO;
case OWSMessageCellType_MediaAlbum: case OWSMessageCellType_MediaAlbum:
// Is there a gallery title? // Is there an album title?
return self.hasBodyText; return self.hasBodyText;
} }
} }
@ -1414,9 +1414,9 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
OWSAssertDebug(self.viewItem.mediaAlbumItems.count > 0); OWSAssertDebug(self.viewItem.mediaAlbumItems.count > 0);
// For now, use first valid attachment. // For now, use first valid attachment.
TSAttachmentStream *_Nullable attachmentStream = self.viewItem.firstValidGalleryAttachment; TSAttachmentStream *_Nullable attachmentStream = self.viewItem.firstValidAlbumAttachment;
if (!attachmentStream) { if (!attachmentStream) {
OWSLogInfo(@"Ignoring tap on gallery without any valid attachments."); OWSLogInfo(@"Ignoring tap on album without any valid attachments.");
return; return;
} }

@ -144,7 +144,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType);
// For other view views (like the typing indicator), this is a unique, stable string. // For other view views (like the typing indicator), this is a unique, stable string.
- (NSString *)itemId; - (NSString *)itemId;
- (nullable TSAttachmentStream *)firstValidGalleryAttachment; - (nullable TSAttachmentStream *)firstValidAlbumAttachment;
@end @end

@ -409,7 +409,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
} }
} }
- (nullable TSAttachmentStream *)firstValidGalleryAttachment - (nullable TSAttachmentStream *)firstValidAlbumAttachment
{ {
OWSAssertDebug(self.mediaAlbumItems.count > 0); OWSAssertDebug(self.mediaAlbumItems.count > 0);
@ -575,9 +575,9 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
NSArray<ConversationMediaAlbumItem *> *mediaAlbumItems = [self mediaAlbumItemsForAttachments:attachments]; NSArray<ConversationMediaAlbumItem *> *mediaAlbumItems = [self mediaAlbumItemsForAttachments:attachments];
self.mediaAlbumItems = mediaAlbumItems; self.mediaAlbumItems = mediaAlbumItems;
self.messageCellType = OWSMessageCellType_MediaAlbum; self.messageCellType = OWSMessageCellType_MediaAlbum;
NSString *_Nullable galleryTitle = [message bodyTextWithTransaction:transaction]; NSString *_Nullable albumTitle = [message bodyTextWithTransaction:transaction];
if (galleryTitle) { if (albumTitle) {
self.displayableBodyText = [self displayableBodyTextForText:galleryTitle interactionId:message.uniqueId]; self.displayableBodyText = [self displayableBodyTextForText:albumTitle interactionId:message.uniqueId];
} }
return; return;
} }
@ -899,7 +899,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
break; break;
} }
case OWSMessageCellType_MediaAlbum: { case OWSMessageCellType_MediaAlbum: {
OWSFailDebug(@"Can't copy media gallery"); OWSFailDebug(@"Can't copy media album");
break; break;
} }
} }
@ -952,7 +952,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
} }
} }
if (attachmentStreams.count < 1) { if (attachmentStreams.count < 1) {
OWSFailDebug(@"Can't share media gallery; no valid items."); OWSFailDebug(@"Can't share media album; no valid items.");
return; return;
} }
[AttachmentSharing showShareUIForAttachments:attachmentStreams completion:nil]; [AttachmentSharing showShareUIForAttachments:attachmentStreams completion:nil];
@ -1126,7 +1126,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
} }
case OWSMessageCellType_MediaAlbum: case OWSMessageCellType_MediaAlbum:
// TODO: I suspect we need separate "can save media", "can share media", etc. methods. // TODO: I suspect we need separate "can save media", "can share media", etc. methods.
return self.firstValidGalleryAttachment != nil; return self.firstValidAlbumAttachment != nil;
} }
} }

Loading…
Cancel
Save