mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add RoomChangeRolesScreen. (#2534)
Not part of a flow yet, just the screen.
This commit is contained in:
@@ -395,6 +395,16 @@ class RoomProxy: RoomProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func updatePowerLevelsForUsers(_ updates: [(userID: String, powerLevel: Int64)]) async -> Result<Void, RoomProxyError> {
|
||||
do {
|
||||
let updates = updates.map { UserPowerLevelUpdate(userId: $0.userID, powerLevel: $0.powerLevel) }
|
||||
return try await .success(room.updatePowerLevelsForUsers(updates: updates))
|
||||
} catch {
|
||||
MXLog.error("Failed updating user power levels changes: \(error)")
|
||||
return .failure(.failedSettingPermission)
|
||||
}
|
||||
}
|
||||
|
||||
func canUser(userID: String, sendStateEvent event: StateEventType) async -> Result<Bool, RoomProxyError> {
|
||||
do {
|
||||
return try await .success(room.canUserSendState(userId: userID, stateEvent: event))
|
||||
|
||||
@@ -118,6 +118,7 @@ protocol RoomProxyProtocol {
|
||||
|
||||
func currentPowerLevelChanges() async -> Result<RoomPowerLevelChanges, RoomProxyError>
|
||||
func applyPowerLevelChanges(_ changes: RoomPowerLevelChanges) async -> Result<Void, RoomProxyError>
|
||||
func updatePowerLevelsForUsers(_ updates: [(userID: String, powerLevel: Int64)]) async -> Result<Void, RoomProxyError>
|
||||
func canUser(userID: String, sendStateEvent event: StateEventType) async -> Result<Bool, RoomProxyError>
|
||||
func canUserInvite(userID: String) async -> Result<Bool, RoomProxyError>
|
||||
func canUserRedactOther(userID: String) async -> Result<Bool, RoomProxyError>
|
||||
|
||||
Reference in New Issue
Block a user