Bug Fix - Room Preview: the room avatar is missing on invited room received by email

#371
This commit is contained in:
giomfo
2016-06-06 16:01:31 +02:00
parent b8c1f695c0
commit 4389630e22
3 changed files with 30 additions and 15 deletions
+11 -3
View File
@@ -879,7 +879,9 @@
[self setRoomTitleViewClass:RoomAvatarTitleView.class];
// Note the avatar title view does not define tap gesture.
roomAvatarView = ((RoomAvatarTitleView*)self.titleView).roomAvatar;
RoomAvatarTitleView *roomAvatarTitleView = (RoomAvatarTitleView*)self.titleView;
roomAvatarView = roomAvatarTitleView.roomAvatar;
roomAvatarView.alpha = 0.0;
shadowImage = [[UIImage alloc] init];
@@ -887,12 +889,18 @@
// Set the avatar provided in preview data
if (roomPreviewData.roomAvatarUrl)
{
RoomAvatarTitleView *roomAvatarTitleView = (RoomAvatarTitleView*)self.titleView;
MXKImageView *roomAvatarView = roomAvatarTitleView.roomAvatar;
NSString *roomAvatarUrl = [self.mainSession.matrixRestClient urlOfContentThumbnail:roomPreviewData.roomAvatarUrl toFitViewSize:roomAvatarView.frame.size withMethod:MXThumbnailingMethodCrop];
roomAvatarTitleView.roomAvatarURL = roomAvatarUrl;
}
else if (roomPreviewData.roomId && roomPreviewData.roomName)
{
roomAvatarTitleView.roomAvatarPlaceholder = [AvatarGenerator generateRoomAvatar:roomPreviewData.roomId andDisplayName:roomPreviewData.roomName];
}
else
{
roomAvatarTitleView.roomAvatarPlaceholder = [UIImage imageNamed:@"placeholder"];
}
}
else
{