Rename AttachmentStream methods.

pull/1/head
Matthew Chen 7 years ago
parent 498828f93c
commit 446ceb2b9c

@ -855,7 +855,7 @@ NS_ASSUME_NONNULL_BEGIN
< kMaxCachableSize; < kMaxCachableSize;
stillImageView.image = [strongSelf tryToLoadCellMedia:^{ stillImageView.image = [strongSelf tryToLoadCellMedia:^{
OWSCAssert([strongSelf.attachmentStream isImage]); OWSCAssert([strongSelf.attachmentStream isImage]);
return strongSelf.attachmentStream.image; return strongSelf.attachmentStream.originalImage;
} }
mediaView:stillImageView mediaView:stillImageView
cacheKey:strongSelf.attachmentStream.uniqueId cacheKey:strongSelf.attachmentStream.uniqueId
@ -979,7 +979,7 @@ NS_ASSUME_NONNULL_BEGIN
stillImageView.image = [strongSelf tryToLoadCellMedia:^{ stillImageView.image = [strongSelf tryToLoadCellMedia:^{
OWSCAssert([strongSelf.attachmentStream isVideo]); OWSCAssert([strongSelf.attachmentStream isVideo]);
return strongSelf.attachmentStream.image; return strongSelf.attachmentStream.originalImage;
} }
mediaView:stillImageView mediaView:stillImageView
cacheKey:strongSelf.attachmentStream.uniqueId cacheKey:strongSelf.attachmentStream.uniqueId

@ -73,7 +73,7 @@ NS_ASSUME_NONNULL_BEGIN
_galleryItemBox = galleryItemBox; _galleryItemBox = galleryItemBox;
_viewItem = viewItem; _viewItem = viewItem;
// We cache the image data in case the attachment stream is deleted. // We cache the image data in case the attachment stream is deleted.
_image = galleryItemBox.attachmentStream.image; _image = galleryItemBox.attachmentStream.originalImage;
return self; return self;
} }

@ -43,7 +43,7 @@ public struct MediaGalleryItem: Equatable, Hashable {
} }
var fullSizedImage: UIImage { var fullSizedImage: UIImage {
guard let image = attachmentStream.image() else { guard let image = attachmentStream.originalImage() else {
owsFail("\(logTag) in \(#function) unexpectedly unable to build attachment image") owsFail("\(logTag) in \(#function) unexpectedly unable to build attachment image")
return UIImage() return UIImage()
} }

@ -88,7 +88,7 @@ NS_ASSUME_NONNULL_BEGIN
TSAttachmentStream *attachmentStream; TSAttachmentStream *attachmentStream;
if ([attachment isKindOfClass:[TSAttachmentStream class]]) { if ([attachment isKindOfClass:[TSAttachmentStream class]]) {
attachmentStream = (TSAttachmentStream *)attachment; attachmentStream = (TSAttachmentStream *)attachment;
thumbnailImage = attachmentStream.image; thumbnailImage = attachmentStream.originalImage;
} }
} else if (attachmentInfo.thumbnailAttachmentPointerId) { } else if (attachmentInfo.thumbnailAttachmentPointerId) {
// download failed, or hasn't completed yet. // download failed, or hasn't completed yet.

@ -191,7 +191,7 @@ NSString *const TSGroupThread_NotificationKey_UniqueId = @"TSGroupThread_Notific
OWSAssert(attachmentStream); OWSAssert(attachmentStream);
OWSAssert(transaction); OWSAssert(transaction);
self.groupModel.groupImage = [attachmentStream image]; self.groupModel.groupImage = [attachmentStream originalImage];
[self saveWithTransaction:transaction]; [self saveWithTransaction:transaction];
[transaction addCompletionQueue:nil [transaction addCompletionQueue:nil

@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, readonly) NSDate *creationTimestamp; @property (nonatomic, readonly) NSDate *creationTimestamp;
#if TARGET_OS_IPHONE #if TARGET_OS_IPHONE
- (nullable UIImage *)image; - (nullable UIImage *)originalImage;
- (nullable UIImage *)thumbnailImage; - (nullable UIImage *)thumbnailImage;
- (nullable NSData *)thumbnailData; - (nullable NSData *)thumbnailData;
- (nullable NSData *)validStillImageData; - (nullable NSData *)validStillImageData;

@ -333,7 +333,7 @@ const CGFloat kMaxVideoStillSize = 1 * 1024;
#pragma mark - #pragma mark -
- (nullable UIImage *)image - (nullable UIImage *)originalImage
{ {
if ([self isVideo]) { if ([self isVideo]) {
return [self videoStillImage]; return [self videoStillImage];

Loading…
Cancel
Save