WIP: Support using Element Call for voice calls in DMs

This commit is contained in:
Valere 2026-01-12 10:48:20 +01:00 committed by Benoit Marty
parent 66c3bf267a
commit ec420332c3
26 changed files with 122 additions and 42 deletions

View file

@ -88,7 +88,8 @@ class RingingCallNotificationCreator(
.setImportant(true)
.build()
val answerIntent = IntentProvider.getPendingIntent(context, CallType.RoomCall(sessionId, roomId))
// TODO
val answerIntent = IntentProvider.getPendingIntent(context, CallType.RoomCall(sessionId, roomId, voiceIntent = false))
val notificationData = CallNotificationData(
sessionId = sessionId,
roomId = roomId,

View file

@ -45,8 +45,9 @@ class DeclineCallBroadcastReceiver : BroadcastReceiver() {
callType = CallType.RoomCall(
sessionId = notificationData.sessionId,
roomId = notificationData.roomId,
),
notificationData = notificationData,
// TODO
voiceIntent = false
)
)
}
}

View file

@ -226,6 +226,7 @@ class CallScreenPresenter(
sessionId = inputs.sessionId,
roomId = inputs.roomId,
clientId = UUID.randomUUID().toString(),
voiceOnly = inputs.voiceIntent,
languageTag = languageTag,
theme = theme,
).getOrThrow()

View file

@ -112,7 +112,14 @@ class IncomingCallActivity : AppCompatActivity() {
}
private fun onAnswer(notificationData: CallNotificationData) {
elementCallEntryPoint.startCall(CallType.RoomCall(notificationData.sessionId, notificationData.roomId))
elementCallEntryPoint.startCall(
CallType.RoomCall(
notificationData.sessionId,
notificationData.roomId,
// TODO
voiceIntent = false
)
)
}
private fun onCancel() {

View file

@ -146,6 +146,8 @@ class DefaultActiveCallManager(
callType = CallType.RoomCall(
sessionId = notificationData.sessionId,
roomId = notificationData.roomId,
// TODO
voiceIntent = false,
),
callState = CallState.Ringing(notificationData),
)

View file

@ -16,6 +16,7 @@ interface CallWidgetProvider {
suspend fun getWidget(
sessionId: SessionId,
roomId: RoomId,
voiceOnly: Boolean,
clientId: String,
languageTag: String?,
theme: String?,

View file

@ -32,6 +32,7 @@ class DefaultCallWidgetProvider(
override suspend fun getWidget(
sessionId: SessionId,
roomId: RoomId,
voiceOnly: Boolean,
clientId: String,
languageTag: String?,
theme: String?,
@ -50,6 +51,7 @@ class DefaultCallWidgetProvider(
baseUrl = baseUrl,
encrypted = isEncrypted,
direct = room.isDm(),
voiceOnly = voiceOnly,
hasActiveCall = roomInfo.hasRoomCall,
)
val callUrl = room.generateWidgetWebViewUrl(