mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Restore permissions to creator and display them as owners in the list (#4369)
* restore permissions to creator and display them as owners in the list * improved the code to use actually 5 roles in the app to distinguish a real creator from an owner
This commit is contained in:
@@ -26,16 +26,6 @@ struct RoomPowerLevelsProxy: RoomPowerLevelsProxyProtocol {
|
||||
powerLevels.userPowerLevels()
|
||||
}
|
||||
|
||||
func suggestedRole(forUser userID: String) -> RoomMemberRole {
|
||||
do {
|
||||
let powerLevelValue = powerLevels.userPowerLevels()[userID] ?? values.usersDefault
|
||||
return try suggestedRoleForPowerLevel(powerLevel: .value(value: powerLevelValue))
|
||||
} catch {
|
||||
MXLog.error("Falied to get suggested role for user: \(error)")
|
||||
return .user
|
||||
}
|
||||
}
|
||||
|
||||
func canOwnUser(sendMessage messageType: MessageLikeEventType) -> Bool {
|
||||
powerLevels.canOwnUserSendMessage(message: messageType)
|
||||
}
|
||||
@@ -76,6 +66,10 @@ struct RoomPowerLevelsProxy: RoomPowerLevelsProxyProtocol {
|
||||
powerLevels.canOwnUserSendState(stateEvent: .callMember)
|
||||
}
|
||||
|
||||
func canOwnUserEditRolesAndPermissions() -> Bool {
|
||||
powerLevels.canOwnUserSendState(stateEvent: .roomPowerLevels)
|
||||
}
|
||||
|
||||
func canUser(userID: String, sendMessage messageType: MessageLikeEventType) -> Result<Bool, RoomProxyError> {
|
||||
do {
|
||||
return try .success(powerLevels.canUserSendMessage(userId: userID, message: messageType))
|
||||
|
||||
Reference in New Issue
Block a user