call: Support voice only incoming call

This commit is contained in:
Valere
2026-03-23 14:55:40 +01:00
committed by Mauro
parent 867d3476c3
commit fec4f7d9ee
16 changed files with 73 additions and 59 deletions
+7 -9
View File
@@ -9,14 +9,12 @@
import MatrixRustSDK
extension RoomProtocol {
var joinCallIntent: Intent {
get async {
switch await (hasActiveRoomCall(), isDirect()) {
case (true, true): .joinExistingDm
case (true, false): .joinExisting
case (false, true): .startCallDm
case (false, false): .startCall
}
func joinCallIntent(voiceOnly: Bool) async -> Intent {
switch await (hasActiveRoomCall(), isDirect()) {
case (true, true): voiceOnly ? .joinExistingDmVoice : .joinExistingDm
case (true, false): .joinExisting
case (false, true): voiceOnly ? .startCallDmVoice : .startCallDm
case (false, false): .startCall
}
}
}
}