WIP: Support using Element Call for voice calls in DMs
This commit is contained in:
@@ -26,9 +26,10 @@ sealed interface CallType : NodeInputs, Parcelable {
|
||||
data class RoomCall(
|
||||
val sessionId: SessionId,
|
||||
val roomId: RoomId,
|
||||
val voiceIntent: Boolean
|
||||
) : CallType {
|
||||
override fun toString(): String {
|
||||
return "RoomCall(sessionId=$sessionId, roomId=$roomId)"
|
||||
return "RoomCall(sessionId=$sessionId, roomId=$roomId, voiceIntent=$voiceIntent)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -45,8 +45,9 @@ class DeclineCallBroadcastReceiver : BroadcastReceiver() {
|
||||
callType = CallType.RoomCall(
|
||||
sessionId = notificationData.sessionId,
|
||||
roomId = notificationData.roomId,
|
||||
),
|
||||
notificationData = notificationData,
|
||||
// TODO
|
||||
voiceIntent = false
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -226,6 +226,7 @@ class CallScreenPresenter(
|
||||
sessionId = inputs.sessionId,
|
||||
roomId = inputs.roomId,
|
||||
clientId = UUID.randomUUID().toString(),
|
||||
voiceOnly = inputs.voiceIntent,
|
||||
languageTag = languageTag,
|
||||
theme = theme,
|
||||
).getOrThrow()
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -146,6 +146,8 @@ class DefaultActiveCallManager(
|
||||
callType = CallType.RoomCall(
|
||||
sessionId = notificationData.sessionId,
|
||||
roomId = notificationData.roomId,
|
||||
// TODO
|
||||
voiceIntent = false,
|
||||
),
|
||||
callState = CallState.Ringing(notificationData),
|
||||
)
|
||||
|
||||
@@ -16,6 +16,7 @@ interface CallWidgetProvider {
|
||||
suspend fun getWidget(
|
||||
sessionId: SessionId,
|
||||
roomId: RoomId,
|
||||
voiceOnly: Boolean,
|
||||
clientId: String,
|
||||
languageTag: String?,
|
||||
theme: String?,
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user