Make the room power levels optional as they can be missing depending on what state events are requested

This commit is contained in:
Stefan Ceriu
2025-06-25 12:35:04 +03:00
committed by Stefan Ceriu
parent c7ff6c019d
commit de723853e3
16 changed files with 65 additions and 45 deletions
@@ -552,7 +552,7 @@ class JoinedRoomProxy: JoinedRoomProxyProtocol {
// MARK: - Power Levels
func powerLevels() async -> Result<RoomPowerLevelsProxyProtocol, RoomProxyError> {
func powerLevels() async -> Result<RoomPowerLevelsProxyProtocol?, RoomProxyError> {
do {
return try await .success(RoomPowerLevelsProxy(room.getPowerLevels()))
} catch {