Element Call permission tweaks (#2187)

* vector-im/element-meta/issues/2230 - Specify `call.member` default power levels when creating a room

* vector-im/element-meta/issues/2229 - Take into account permissions when configuring the room screen call button
This commit is contained in:
Stefan Ceriu
2023-12-06 13:14:23 +02:00
committed by GitHub
parent c7531be44c
commit 6cd25fac50
11 changed files with 78 additions and 9 deletions
@@ -396,6 +396,15 @@ class RoomProxy: RoomProxyProtocol {
}
}
func canUserJoinCall(userID: String) async -> Result<Bool, RoomProxyError> {
do {
return try await .success(room.canUserSendState(userId: userID, stateEvent: .callMember))
} catch {
MXLog.error("Failed checking if the user can trigger room notification with error: \(error)")
return .failure(.failedCheckingPermission)
}
}
// MARK: - Element Call
func elementCallWidgetDriver() -> ElementCallWidgetDriverProtocol {
@@ -114,6 +114,8 @@ protocol RoomProxyProtocol {
func canUserTriggerRoomNotification(userID: String) async -> Result<Bool, RoomProxyError>
func canUserJoinCall(userID: String) async -> Result<Bool, RoomProxyError>
// MARK: - Element Call
func elementCallWidgetDriver() -> ElementCallWidgetDriverProtocol