mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +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:
@@ -21,8 +21,7 @@ struct ElementCallConfiguration {
|
||||
clientID: String,
|
||||
elementCallBaseURL: URL,
|
||||
elementCallBaseURLOverride: URL?,
|
||||
colorScheme: ColorScheme,
|
||||
notifyOtherParticipants: Bool)
|
||||
colorScheme: ColorScheme)
|
||||
}
|
||||
|
||||
/// The type of call being configured i.e. whether it's an external URL or an internal room call.
|
||||
@@ -59,15 +58,13 @@ struct ElementCallConfiguration {
|
||||
clientID: String,
|
||||
elementCallBaseURL: URL,
|
||||
elementCallBaseURLOverride: URL?,
|
||||
colorScheme: ColorScheme,
|
||||
notifyOtherParticipants: Bool) {
|
||||
colorScheme: ColorScheme) {
|
||||
kind = .roomCall(roomProxy: roomProxy,
|
||||
clientProxy: clientProxy,
|
||||
clientID: clientID,
|
||||
elementCallBaseURL: elementCallBaseURL,
|
||||
elementCallBaseURLOverride: elementCallBaseURLOverride,
|
||||
colorScheme: colorScheme,
|
||||
notifyOtherParticipants: notifyOtherParticipants)
|
||||
colorScheme: colorScheme)
|
||||
}
|
||||
|
||||
/// A string representing the call being configured.
|
||||
@@ -75,7 +72,7 @@ struct ElementCallConfiguration {
|
||||
switch kind {
|
||||
case .genericCallLink(let url):
|
||||
url.absoluteString
|
||||
case .roomCall(let roomProxy, _, _, _, _, _, _):
|
||||
case .roomCall(let roomProxy, _, _, _, _, _):
|
||||
roomProxy.id
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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