MESSENGER-3310 use local personal note avatar and remove url of old rooms

This commit is contained in:
Frank Rotermund
2022-07-22 16:50:46 +02:00
parent 1c4d623de4
commit ecdd1e3a48
11 changed files with 80 additions and 25 deletions
@@ -2397,10 +2397,19 @@ NSString *const kRoomSettingsAdvancedE2eEnabledCellViewIdentifier = @"kRoomSetti
}
else
{
[mxRoom.summary setRoomAvatarImageIn:roomPhotoCell.mxkImageView];
roomPhotoCell.userInteractionEnabled = (oneSelfPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomAvatar]);
roomPhotoCell.mxkImageView.alpha = roomPhotoCell.userInteractionEnabled ? 1.0f : 0.5f;
// bwi if the room is a personal notes room use a local image
if (BwiBuildSettings.bwiUseCustomPersonalNotesAvatar && [mxRoom isPersonalNotesRoom] ) {
PersonalNotesDefaultService *service = [[PersonalNotesDefaultService alloc] initWithMxSession:self.mainSession];
roomPhotoCell.mxkImageView.image = [UIImage imageNamed:service.avatarImageUrl];
roomPhotoCell.userInteractionEnabled = false;
roomPhotoCell.mxkImageView.alpha = 0.5f;
} else {
[mxRoom.summary setRoomAvatarImageIn:roomPhotoCell.mxkImageView];
roomPhotoCell.userInteractionEnabled = (oneSelfPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomAvatar]);
roomPhotoCell.mxkImageView.alpha = roomPhotoCell.userInteractionEnabled ? 1.0f : 0.5f;
}
}
cell = roomPhotoCell;