Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Bug Fix - Chat screen: image thumbnails management is broken
Browse files Browse the repository at this point in the history
element-hq/element-ios#1121

The thumbnail url was computed before retrieving the content url. The resulting url was nil.
  • Loading branch information
giomfo committed Mar 22, 2017
1 parent 4f2306b commit 120e1e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions MatrixKit/Models/Room/MXKAttachment.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ - (instancetype)initWithEvent:(MXEvent *)mxEvent andMatrixSession:(MXSession*)mx

thumbnailFile = _contentInfo[@"thumbnail_file"];

_thumbnailURL = [self getThumbnailUrlForSize:CGSizeMake(kThumbnailWidth, kThumbnailHeight)];
_thumbnailMimeType = [self getThumbnailMimeType];

contentFile = eventContent[@"file"];

// Retrieve the content url by taking into account the potential encryption.
Expand Down Expand Up @@ -155,6 +152,10 @@ - (instancetype)initWithEvent:(MXEvent *)mxEvent andMatrixSession:(MXSession*)mx
}

_cacheFilePath = [MXMediaManager cachePathForMediaWithURL:_actualURL andType:mimetype inFolder:_eventRoomId];

// Deduce the thumbnail information from the retrieved data.
_thumbnailURL = [self getThumbnailUrlForSize:CGSizeMake(kThumbnailWidth, kThumbnailHeight)];
_thumbnailMimeType = [self getThumbnailMimeType];
}
return self;
}
Expand Down

0 comments on commit 120e1e4

Please sign in to comment.