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:
Robin
2025-08-01 18:47:48 +02:00
committed by GitHub
parent 731d60b6e9
commit 514c7808e2
13 changed files with 208 additions and 245 deletions
@@ -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)