@@ -21,7 +21,8 @@ import org.matrix.rustcomponents.sdk.newVirtualElementCallWidget
21
21
import uniffi.matrix_sdk.EncryptionSystem
22
22
import uniffi.matrix_sdk.HeaderStyle
23
23
import uniffi.matrix_sdk.NotificationType
24
- import uniffi.matrix_sdk.VirtualElementCallWidgetOptions
24
+ import uniffi.matrix_sdk.VirtualElementCallWidgetConfig
25
+ import uniffi.matrix_sdk.VirtualElementCallWidgetProperties
25
26
import uniffi.matrix_sdk.Intent as CallIntent
26
27
27
28
@ContributesBinding(AppScope ::class )
@@ -33,31 +34,37 @@ class DefaultCallWidgetSettingsProvider(
33
34
) : CallWidgetSettingsProvider {
34
35
override suspend fun provide (baseUrl : String , widgetId : String , encrypted : Boolean , direct : Boolean ): MatrixWidgetSettings {
35
36
val isAnalyticsEnabled = analyticsService.userConsentFlow.first()
36
- val options = VirtualElementCallWidgetOptions (
37
+ val properties = VirtualElementCallWidgetProperties (
37
38
elementCallUrl = baseUrl,
38
39
widgetId = widgetId,
39
- preload = null ,
40
40
fontScale = null ,
41
- appPrompt = false ,
42
- confineToRoom = true ,
43
41
font = null ,
44
42
encryption = if (encrypted) EncryptionSystem .PerParticipantKeys else EncryptionSystem .Unencrypted ,
45
- intent = CallIntent .START_CALL ,
46
- hideScreensharing = false ,
47
43
posthogUserId = callAnalyticsCredentialsProvider.posthogUserId.takeIf { isAnalyticsEnabled },
48
44
posthogApiHost = callAnalyticsCredentialsProvider.posthogApiHost.takeIf { isAnalyticsEnabled },
49
45
posthogApiKey = callAnalyticsCredentialsProvider.posthogApiKey.takeIf { isAnalyticsEnabled },
50
46
rageshakeSubmitUrl = callAnalyticsCredentialsProvider.rageshakeSubmitUrl,
51
47
sentryDsn = callAnalyticsCredentialsProvider.sentryDsn.takeIf { isAnalyticsEnabled },
52
48
sentryEnvironment = if (buildMeta.buildType == BuildType .RELEASE ) " RELEASE" else " DEBUG" ,
53
49
parentUrl = null ,
50
+ )
51
+ val config = VirtualElementCallWidgetConfig (
52
+ preload = null ,
53
+ appPrompt = false ,
54
+ confineToRoom = true ,
55
+ intent = CallIntent .START_CALL ,
56
+ hideScreensharing = false ,
54
57
// For backwards compatibility, it'll be ignored in recent versions of Element Call
55
58
hideHeader = true ,
56
- controlledMediaDevices = true ,
59
+ controlledAudioDevices = true ,
57
60
header = HeaderStyle .APP_BAR ,
58
61
sendNotificationType = if (direct) NotificationType .RING else NotificationType .NOTIFICATION ,
62
+ skipLobby = null ,
63
+ )
64
+ val rustWidgetSettings = newVirtualElementCallWidget(
65
+ props = properties,
66
+ config = config,
59
67
)
60
- val rustWidgetSettings = newVirtualElementCallWidget(options)
61
68
return MatrixWidgetSettings .fromRustWidgetSettings(rustWidgetSettings)
62
69
}
63
70
}
0 commit comments