|
|
@ -524,10 +524,11 @@ typedef void (^OWSLoadedThumbnailSuccess)(OWSLoadedThumbnail *loadedThumbnail);
|
|
|
|
self.cachedImageHeight = @(imageSize.height);
|
|
|
|
self.cachedImageHeight = @(imageSize.height);
|
|
|
|
|
|
|
|
|
|
|
|
[self.dbReadWriteConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
[self.dbReadWriteConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
|
|
|
|
NSString *collection = [TSAttachmentStream collection];
|
|
|
|
NSString *collection = [[self class] collection];
|
|
|
|
|
|
|
|
TSAttachmentStream *latestInstance = [transaction objectForKey:self.uniqueId inCollection:collection];
|
|
|
|
TSAttachmentStream *latestInstance = [transaction objectForKey:self.uniqueId inCollection:collection];
|
|
|
|
if (latestInstance) {
|
|
|
|
if (![latestInstance isKindOfClass:[TSAttachmentStream class]]) {
|
|
|
|
|
|
|
|
OWSFailDebug(@"Attachment has unexpected type: %@", latestInstance.class);
|
|
|
|
|
|
|
|
} else if (latestInstance) {
|
|
|
|
latestInstance.cachedImageWidth = @(imageSize.width);
|
|
|
|
latestInstance.cachedImageWidth = @(imageSize.width);
|
|
|
|
latestInstance.cachedImageHeight = @(imageSize.height);
|
|
|
|
latestInstance.cachedImageHeight = @(imageSize.height);
|
|
|
|
[latestInstance saveWithTransaction:transaction];
|
|
|
|
[latestInstance saveWithTransaction:transaction];
|
|
|
|