|
|
@ -837,8 +837,9 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
stillImageView.backgroundColor = [UIColor whiteColor];
|
|
|
|
stillImageView.backgroundColor = [UIColor whiteColor];
|
|
|
|
[self addAttachmentUploadViewIfNecessary];
|
|
|
|
[self addAttachmentUploadViewIfNecessary];
|
|
|
|
|
|
|
|
|
|
|
|
__weak OWSMessageBubbleView *weakSelf = self;
|
|
|
|
|
|
|
|
__weak UIImageView *weakImageView = stillImageView;
|
|
|
|
__weak UIImageView *weakImageView = stillImageView;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
__weak OWSMessageBubbleView *weakSelf = self;
|
|
|
|
self.loadCellContentBlock = ^{
|
|
|
|
self.loadCellContentBlock = ^{
|
|
|
|
OWSMessageBubbleView *strongSelf = weakSelf;
|
|
|
|
OWSMessageBubbleView *strongSelf = weakSelf;
|
|
|
|
if (!strongSelf) {
|
|
|
|
if (!strongSelf) {
|
|
|
@ -979,7 +980,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
|
|
__weak OWSMessageBubbleView *weakSelf = self;
|
|
|
|
__weak OWSMessageBubbleView *weakSelf = self;
|
|
|
|
__weak UIImageView *weakImageView = stillImageView;
|
|
|
|
|
|
|
|
self.loadCellContentBlock = ^{
|
|
|
|
self.loadCellContentBlock = ^{
|
|
|
|
OWSMessageBubbleView *strongSelf = weakSelf;
|
|
|
|
OWSMessageBubbleView *strongSelf = weakSelf;
|
|
|
|
if (!strongSelf) {
|
|
|
|
if (!strongSelf) {
|
|
|
@ -990,22 +990,6 @@ NS_ASSUME_NONNULL_BEGIN
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stillImageView.image = [strongSelf
|
|
|
|
stillImageView.image = [strongSelf
|
|
|
|
tryToLoadCellMedia:^{
|
|
|
|
|
|
|
|
OWSCAssert([strongSelf.attachmentStream isImage]);
|
|
|
|
|
|
|
|
return [strongSelf.attachmentStream
|
|
|
|
|
|
|
|
thumbnailImageMediumWithSuccess:^(UIImage *image) {
|
|
|
|
|
|
|
|
weakImageView.image = image;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
failure:^{
|
|
|
|
|
|
|
|
DDLogError(@"Could not load thumbnail.");
|
|
|
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mediaView:stillImageView
|
|
|
|
|
|
|
|
cacheKey:strongSelf.attachmentStream.uniqueId
|
|
|
|
|
|
|
|
shouldSkipCache:shouldSkipCache
|
|
|
|
|
|
|
|
canLoadAsync:YES];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tryToLoadCellMedia:^{
|
|
|
|
tryToLoadCellMedia:^{
|
|
|
|
OWSCAssert([strongSelf.attachmentStream isVideo]);
|
|
|
|
OWSCAssert([strongSelf.attachmentStream isVideo]);
|
|
|
|
|
|
|
|
|
|
|
|