Report Matrix SDK api changes (urlOfContentThumbnail)

This commit is contained in:
giomfo
2015-04-09 17:43:26 +02:00
parent 1d625ae5dc
commit 30812cb955
6 changed files with 5 additions and 26 deletions
-17
View File
@@ -1285,21 +1285,4 @@ static MatrixSDKHandler *sharedHandler = nil;
return NO;
}
#pragma mark - Thumbnail
// Return the suitable url to display the content thumbnail into the provided view size
// Note: the provided view size is supposed in points, this method will convert this size in pixels by considering screen scale
- (NSString*)thumbnailURLForContent:(NSString*)contentURI inViewSize:(CGSize)viewSize withMethod:(MXThumbnailingMethod)thumbnailingMethod {
// Suppose this url is a matrix content uri, we use SDK to get the well adapted thumbnail from server
// Convert first the provided size in pixels
CGFloat scale = [[UIScreen mainScreen] scale];
CGSize sizeInPixels = CGSizeMake(viewSize.width * scale, viewSize.height * scale);
NSString *thumbnailURL = [self.mxRestClient urlOfContentThumbnail:contentURI withSize:sizeInPixels andMethod:thumbnailingMethod];
if (nil == thumbnailURL) {
// Manage backward compatibility. The content URL used to be an absolute HTTP URL
thumbnailURL = contentURI;
}
return thumbnailURL;
}
@end