MXImageView: use the new interface [setImageURI:...] instead of the deprecated one [setImageURL:...] .

Note - DirectoryServerTableViewCell:
Presently the thirdPartyProtocolInstance.icon is not a Matrix Content URI. We could not use here MXKImageView setImageURI method
 without breaking the instance icon rendering. We use the deprecated interface until this point is fixed on the server side.
This commit is contained in:
Giom Foret
2018-11-11 15:20:32 +01:00
parent 609174d093
commit dc747fec93
20 changed files with 168 additions and 123 deletions
+10 -10
View File
@@ -1426,14 +1426,16 @@
if (userPictureView)
{
UIImage *preview = [AvatarGenerator generateAvatarForMatrixItem:self.mainSession.myUser.userId withDisplayName:self.mainSession.myUser.displayname];
NSString *avatarThumbURL = nil;
if (self.mainSession.myUser.avatarUrl)
{
// Suppose this url is a matrix content uri, we use SDK to get the well adapted thumbnail from server
avatarThumbURL = [self.mainSession.matrixRestClient urlOfContentThumbnail:self.mainSession.myUser.avatarUrl toFitViewSize:userPictureView.frame.size withMethod:MXThumbnailingMethodCrop];
}
// Suppose the avatar is stored unencrypted on the Matrix media repository.
userPictureView.enableInMemoryCache = YES;
[userPictureView setImageURL:avatarThumbURL withType:nil andImageOrientation:UIImageOrientationUp previewImage:preview];
[userPictureView setImageURI:self.mainSession.myUser.avatarUrl
withType:nil
andImageOrientation:UIImageOrientationUp
toFitViewSize:userPictureView.frame.size
withMethod:MXThumbnailingMethodCrop
previewImage:preview
mediaManager:self.mainSession.mediaManager];
[userPictureView.layer setCornerRadius:userPictureView.frame.size.width / 2];
userPictureView.clipsToBounds = YES;
}
@@ -1731,9 +1733,7 @@
// Set the avatar provided in preview data
if (roomPreviewData.roomAvatarUrl)
{
NSString *roomAvatarUrl = [self.mainSession.matrixRestClient urlOfContentThumbnail:roomPreviewData.roomAvatarUrl toFitViewSize:previewHeader.roomAvatar.frame.size withMethod:MXThumbnailingMethodCrop];
previewHeader.roomAvatarURL = roomAvatarUrl;
previewHeader.roomAvatarURL = roomPreviewData.roomAvatarUrl;
}
else if (roomPreviewData.roomId && roomPreviewData.roomName)
{