|
|
@ -877,15 +877,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case OWSMessageCellType_MediaGallery: {
|
|
|
|
case OWSMessageCellType_MediaGallery: {
|
|
|
|
// AFAIK UIPasteboard only supports "multiple representations
|
|
|
|
OWSFailDebug(@"Can't copy media gallery");
|
|
|
|
// of a single item", not "multiple different items".
|
|
|
|
|
|
|
|
TSAttachmentStream *_Nullable firstAttachment = self.firstValidGalleryAttachment;
|
|
|
|
|
|
|
|
if (!firstAttachment) {
|
|
|
|
|
|
|
|
OWSLogWarn(@"Ignoring copy for gallery without any valid attachments.");
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
[self copyAttachmentToPasteboard:firstAttachment];
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -947,7 +939,7 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
- (BOOL)canSaveMedia
|
|
|
|
- (BOOL)canCopyMedia
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (self.messageCellType) {
|
|
|
|
switch (self.messageCellType) {
|
|
|
|
case OWSMessageCellType_Unknown:
|
|
|
|
case OWSMessageCellType_Unknown:
|
|
|
@ -963,10 +955,30 @@ NSString *NSStringForOWSMessageCellType(OWSMessageCellType cellType)
|
|
|
|
case OWSMessageCellType_Video:
|
|
|
|
case OWSMessageCellType_Video:
|
|
|
|
return UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(self.attachmentStream.originalFilePath);
|
|
|
|
return UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(self.attachmentStream.originalFilePath);
|
|
|
|
case OWSMessageCellType_GenericAttachment:
|
|
|
|
case OWSMessageCellType_GenericAttachment:
|
|
|
|
|
|
|
|
case OWSMessageCellType_DownloadingAttachment:
|
|
|
|
|
|
|
|
case OWSMessageCellType_MediaGallery:
|
|
|
|
return NO;
|
|
|
|
return NO;
|
|
|
|
case OWSMessageCellType_DownloadingAttachment: {
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- (BOOL)canSaveMedia
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
switch (self.messageCellType) {
|
|
|
|
|
|
|
|
case OWSMessageCellType_Unknown:
|
|
|
|
|
|
|
|
case OWSMessageCellType_TextMessage:
|
|
|
|
|
|
|
|
case OWSMessageCellType_OversizeTextMessage:
|
|
|
|
|
|
|
|
case OWSMessageCellType_ContactShare:
|
|
|
|
|
|
|
|
return NO;
|
|
|
|
|
|
|
|
case OWSMessageCellType_StillImage:
|
|
|
|
|
|
|
|
case OWSMessageCellType_AnimatedImage:
|
|
|
|
|
|
|
|
return YES;
|
|
|
|
|
|
|
|
case OWSMessageCellType_Audio:
|
|
|
|
|
|
|
|
return NO;
|
|
|
|
|
|
|
|
case OWSMessageCellType_Video:
|
|
|
|
|
|
|
|
return UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(self.attachmentStream.originalFilePath);
|
|
|
|
|
|
|
|
case OWSMessageCellType_GenericAttachment:
|
|
|
|
|
|
|
|
case OWSMessageCellType_DownloadingAttachment:
|
|
|
|
return NO;
|
|
|
|
return NO;
|
|
|
|
}
|
|
|
|
|
|
|
|
case OWSMessageCellType_MediaGallery: {
|
|
|
|
case OWSMessageCellType_MediaGallery: {
|
|
|
|
for (ConversationMediaGalleryItem *mediaGalleryItem in self.mediaGalleryItems) {
|
|
|
|
for (ConversationMediaGalleryItem *mediaGalleryItem in self.mediaGalleryItems) {
|
|
|
|
if (!mediaGalleryItem.attachmentStream) {
|
|
|
|
if (!mediaGalleryItem.attachmentStream) {
|
|
|
|