Skip to content

Commit 066bfb1

Browse files
committed
SDK API change: handle change on VirtualElementCallWidgetOptions
1 parent e634952 commit 066bfb1

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

libraries/matrix/impl/src/main/kotlin/io/element/android/libraries/matrix/impl/widget/DefaultCallWidgetSettingsProvider.kt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ import org.matrix.rustcomponents.sdk.newVirtualElementCallWidget
2121
import uniffi.matrix_sdk.EncryptionSystem
2222
import uniffi.matrix_sdk.HeaderStyle
2323
import uniffi.matrix_sdk.NotificationType
24-
import uniffi.matrix_sdk.VirtualElementCallWidgetOptions
24+
import uniffi.matrix_sdk.VirtualElementCallWidgetConfig
25+
import uniffi.matrix_sdk.VirtualElementCallWidgetProperties
2526
import uniffi.matrix_sdk.Intent as CallIntent
2627

2728
@ContributesBinding(AppScope::class)
@@ -33,31 +34,37 @@ class DefaultCallWidgetSettingsProvider(
3334
) : CallWidgetSettingsProvider {
3435
override suspend fun provide(baseUrl: String, widgetId: String, encrypted: Boolean, direct: Boolean): MatrixWidgetSettings {
3536
val isAnalyticsEnabled = analyticsService.userConsentFlow.first()
36-
val options = VirtualElementCallWidgetOptions(
37+
val properties = VirtualElementCallWidgetProperties(
3738
elementCallUrl = baseUrl,
3839
widgetId = widgetId,
39-
preload = null,
4040
fontScale = null,
41-
appPrompt = false,
42-
confineToRoom = true,
4341
font = null,
4442
encryption = if (encrypted) EncryptionSystem.PerParticipantKeys else EncryptionSystem.Unencrypted,
45-
intent = CallIntent.START_CALL,
46-
hideScreensharing = false,
4743
posthogUserId = callAnalyticsCredentialsProvider.posthogUserId.takeIf { isAnalyticsEnabled },
4844
posthogApiHost = callAnalyticsCredentialsProvider.posthogApiHost.takeIf { isAnalyticsEnabled },
4945
posthogApiKey = callAnalyticsCredentialsProvider.posthogApiKey.takeIf { isAnalyticsEnabled },
5046
rageshakeSubmitUrl = callAnalyticsCredentialsProvider.rageshakeSubmitUrl,
5147
sentryDsn = callAnalyticsCredentialsProvider.sentryDsn.takeIf { isAnalyticsEnabled },
5248
sentryEnvironment = if (buildMeta.buildType == BuildType.RELEASE) "RELEASE" else "DEBUG",
5349
parentUrl = null,
50+
)
51+
val config = VirtualElementCallWidgetConfig(
52+
preload = null,
53+
appPrompt = false,
54+
confineToRoom = true,
55+
intent = CallIntent.START_CALL,
56+
hideScreensharing = false,
5457
// For backwards compatibility, it'll be ignored in recent versions of Element Call
5558
hideHeader = true,
56-
controlledMediaDevices = true,
59+
controlledAudioDevices = true,
5760
header = HeaderStyle.APP_BAR,
5861
sendNotificationType = if (direct) NotificationType.RING else NotificationType.NOTIFICATION,
62+
skipLobby = null,
63+
)
64+
val rustWidgetSettings = newVirtualElementCallWidget(
65+
props = properties,
66+
config = config,
5967
)
60-
val rustWidgetSettings = newVirtualElementCallWidget(options)
6168
return MatrixWidgetSettings.fromRustWidgetSettings(rustWidgetSettings)
6269
}
6370
}

0 commit comments

Comments
 (0)