Add RoomChangeRolesScreen. (#2534)

Not part of a flow yet, just the screen.
This commit is contained in:
Doug
2024-03-07 16:24:05 +00:00
committed by GitHub
parent 063b3732b1
commit 046f1dd533
19 changed files with 904 additions and 0 deletions
@@ -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>