mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Delegate the sending of call notifications to Element Call (#4370)
* Stop sending call notifications manually The Element Call widget can now assume responsibility for sending them when you start a call. * Bump Element Call embedded package to v0.14.0 * Delegate the sending of call notifications to Element Call * Update the SDK. * Use 'is' prefix for boolean --------- Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
@@ -75,30 +75,32 @@ class ElementCallWidgetDriver: WidgetCapabilitiesProvider, ElementCallWidgetDriv
|
||||
return .failure(.roomInvalid)
|
||||
}
|
||||
|
||||
let useEncryption = await (try? room.latestEncryptionState() == .encrypted) ?? false
|
||||
async let useEncryption = (try? room.latestEncryptionState() == .encrypted) ?? false
|
||||
async let isDirect = room.isDirect()
|
||||
let widgetSettings: WidgetSettings
|
||||
|
||||
do {
|
||||
widgetSettings = try 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))
|
||||
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))
|
||||
} catch {
|
||||
MXLog.error("Failed to build widget settings: \(error)")
|
||||
return .failure(.failedBuildingWidgetSettings)
|
||||
|
||||
Reference in New Issue
Block a user