mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Add intent system to widget URL creation. (#4427)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pixlwave <6060466+pixlwave@users.noreply.github.com> Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
@@ -76,31 +76,32 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
|
||||
}
|
||||
|
||||
async let useEncryption = (try? room.latestEncryptionState() == .encrypted) ?? false
|
||||
async let isDirect = room.isDirect()
|
||||
let widgetSettings: WidgetSettings
|
||||
async let intent = room.joinCallIntent
|
||||
|
||||
let widgetSettings: WidgetSettings
|
||||
do {
|
||||
widgetSettings = try await newVirtualElementCallWidget(props: .init(elementCallUrl: baseURL.absoluteString,
|
||||
widgetId: widgetID,
|
||||
parentUrl: nil,
|
||||
header: .appBar,
|
||||
hideHeader: true,
|
||||
preload: nil,
|
||||
fontScale: nil,
|
||||
appPrompt: false,
|
||||
confineToRoom: true,
|
||||
font: nil,
|
||||
encryption: useEncryption ? .perParticipantKeys : .unencrypted,
|
||||
intent: .startCall,
|
||||
hideScreensharing: false,
|
||||
posthogUserId: nil,
|
||||
posthogApiHost: analyticsConfiguration?.posthogAPIHost,
|
||||
posthogApiKey: analyticsConfiguration?.posthogAPIKey,
|
||||
rageshakeSubmitUrl: rageshakeURL,
|
||||
sentryDsn: analyticsConfiguration?.sentryDSN,
|
||||
sentryEnvironment: nil,
|
||||
controlledMediaDevices: !ProcessInfo.processInfo.isiOSAppOnMac,
|
||||
sendNotificationType: isDirect ? .ring : .notification))
|
||||
sentryEnvironment: nil),
|
||||
config: .init(intent: intent,
|
||||
skipLobby: nil,
|
||||
header: nil,
|
||||
hideHeader: nil,
|
||||
preload: nil,
|
||||
appPrompt: nil,
|
||||
confineToRoom: nil,
|
||||
hideScreensharing: nil,
|
||||
controlledAudioDevices: nil,
|
||||
sendNotificationType: nil))
|
||||
} catch {
|
||||
MXLog.error("Failed to build widget settings: \(error)")
|
||||
return .failure(.failedBuildingWidgetSettings)
|
||||
|
||||
Reference in New Issue
Block a user