room_photo_selection

rename isSuperUser to isModerator
This commit is contained in:
yannick
2015-12-17 11:56:06 +01:00
parent e2cf0564eb
commit 6cafd37dbf
3 changed files with 11 additions and 10 deletions
+2 -2
View File
@@ -27,9 +27,9 @@
@property(nonatomic, readonly) BOOL areRoomNotificationsMuted;
/**
Returns YES if the oneself user is a super user i.e. he is allowed to modify the room members and so on.
Returns YES if the oneself user is a moderator i.e. he is allowed to update the room name or the avatar..
*/
@property(nonatomic, readonly) BOOL isSuperUser;
@property(nonatomic, readonly) BOOL isModerator;
/**
Returns the vector displayname.
+3 -2
View File
@@ -74,10 +74,11 @@
return NO;
}
- (BOOL)isSuperUser
- (BOOL)isModerator
{
// Check whether the user has enough power to rename the room
// Check whether the user has enough power to rename the room or update the avatar
MXRoomPowerLevels *powerLevels = [self.state powerLevels];
NSUInteger userPowerLevel = [powerLevels powerLevelOfUserWithUserID:self.mxSession.myUser.userId];
return (userPowerLevel >= [powerLevels minimumPowerLevelForSendingEventAsStateEvent:kMXEventTypeStringRoomName]);
@@ -592,12 +592,12 @@
else
{
[mxRoom setRoomAvatarImageIn:roomPhotoCell.mxkImageView];
roomPhotoCell.mxkImageView.alpha = isSuperUser ? 1.0f : 0.5f;
roomPhotoCell.mxkImageView.alpha = mxRoom.isModerator ? 1.0f : 0.5f;
}
[roomPhotoCell.mxkImageView.layer setCornerRadius:roomPhotoCell.mxkImageView.frame.size.width / 2];
roomPhotoCell.mxkImageView.clipsToBounds = YES;
roomPhotoCell.userInteractionEnabled = isSuperUser;
roomPhotoCell.userInteractionEnabled = mxRoom.isModerator;
cell = roomPhotoCell;
}
@@ -631,8 +631,8 @@
roomTopicCell.mxkTextView.delegate = self;
// disable the edition if the user cannoy update it
roomTopicCell.mxkTextView.editable = isSuperUser;
roomTopicCell.mxkTextView.textColor = isSuperUser ? [UIColor blackColor] : [UIColor lightGrayColor];
roomTopicCell.mxkTextView.editable = mxRoom.isModerator;
roomTopicCell.mxkTextView.textColor = mxRoom.isModerator ? [UIColor blackColor] : [UIColor lightGrayColor];
cell = roomTopicCell;
}
@@ -663,8 +663,8 @@
nameTextField = roomNameCell.mxkTextField;
// disable the edition if the user cannoy update it
roomNameCell.editable = isSuperUser;
roomNameCell.mxkTextField.textColor = isSuperUser ? [UIColor blackColor] : [UIColor lightGrayColor];
roomNameCell.editable = mxRoom.isModerator;
roomNameCell.mxkTextField.textColor = mxRoom.isModerator ? [UIColor blackColor] : [UIColor lightGrayColor];
// Add a "textFieldDidChange" notification method to the text field control.