mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-29 20:56:57 +02:00
Report Matrix SDK api changes (urlOfContentThumbnail)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user