Rename to media album.
This commit is contained in:
parent
6a3ecb3d07
commit
c1a5e1e258
|
@ -429,7 +429,7 @@ private class MockConversationViewItem: NSObject, ConversationViewItem {
|
|||
return 2
|
||||
}
|
||||
|
||||
func firstValidGalleryAttachment() -> TSAttachmentStream? {
|
||||
func firstValidAlbumAttachment() -> TSAttachmentStream? {
|
||||
owsFailDebug("unexpected invocation")
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
|
|||
case OWSMessageCellType_ContactShare:
|
||||
return NO;
|
||||
case OWSMessageCellType_MediaAlbum:
|
||||
// Is there a gallery title?
|
||||
// Is there an album title?
|
||||
return self.hasBodyText;
|
||||
}
|
||||
}
|
||||
|
@ -1414,9 +1414,9 @@ const UIDataDetectorTypes kOWSAllowedDataDetectorTypes
|
|||
OWSAssertDebug(self.viewItem.mediaAlbumItems.count > 0);
|
||||
|
||||
// For now, use first valid attachment.
|
||||
TSAttachmentStream *_Nullable attachmentStream = self.viewItem.firstValidGalleryAttachment;
|
||||
TSAttachmentStream *_Nullable attachmentStream = self.viewItem.firstValidAlbumAttachment;
|
||||
if (!attachmentStream) {
|
||||
OWSLogInfo(@"Ignoring tap on gallery without any valid attachments.");
|
||||
OWSLogInfo(@"Ignoring tap on album without any valid attachments.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType);
|
|||
// For other view views (like the typing indicator), this is a unique, stable string.
|
||||
- (NSString *)itemId;
|
||||
|
||||
- (nullable TSAttachmentStream *)firstValidGalleryAttachment;
|
||||
- (nullable TSAttachmentStream *)firstValidAlbumAttachment;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -409,7 +409,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
}
|
||||
}
|
||||
|
||||
- (nullable TSAttachmentStream *)firstValidGalleryAttachment
|
||||
- (nullable TSAttachmentStream *)firstValidAlbumAttachment
|
||||
{
|
||||
OWSAssertDebug(self.mediaAlbumItems.count > 0);
|
||||
|
||||
|
@ -575,9 +575,9 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
NSArray<ConversationMediaAlbumItem *> *mediaAlbumItems = [self mediaAlbumItemsForAttachments:attachments];
|
||||
self.mediaAlbumItems = mediaAlbumItems;
|
||||
self.messageCellType = OWSMessageCellType_MediaAlbum;
|
||||
NSString *_Nullable galleryTitle = [message bodyTextWithTransaction:transaction];
|
||||
if (galleryTitle) {
|
||||
self.displayableBodyText = [self displayableBodyTextForText:galleryTitle interactionId:message.uniqueId];
|
||||
NSString *_Nullable albumTitle = [message bodyTextWithTransaction:transaction];
|
||||
if (albumTitle) {
|
||||
self.displayableBodyText = [self displayableBodyTextForText:albumTitle interactionId:message.uniqueId];
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -899,7 +899,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
break;
|
||||
}
|
||||
case OWSMessageCellType_MediaAlbum: {
|
||||
OWSFailDebug(@"Can't copy media gallery");
|
||||
OWSFailDebug(@"Can't copy media album");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -952,7 +952,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
}
|
||||
}
|
||||
if (attachmentStreams.count < 1) {
|
||||
OWSFailDebug(@"Can't share media gallery; no valid items.");
|
||||
OWSFailDebug(@"Can't share media album; no valid items.");
|
||||
return;
|
||||
}
|
||||
[AttachmentSharing showShareUIForAttachments:attachmentStreams completion:nil];
|
||||
|
@ -1126,7 +1126,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|||
}
|
||||
case OWSMessageCellType_MediaAlbum:
|
||||
// TODO: I suspect we need separate "can save media", "can share media", etc. methods.
|
||||
return self.firstValidGalleryAttachment != nil;
|
||||
return self.firstValidAlbumAttachment != nil;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue