mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Make Element Call widget URL configurable (#2971)
This commit is contained in:
@@ -38,9 +38,11 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
||||
/// - callBaseURL: Which Element Call instance should be used
|
||||
/// - clientID: Something to identify the current client on the Element Call side
|
||||
init(elementCallService: ElementCallServiceProtocol,
|
||||
clientProxy: ClientProxyProtocol,
|
||||
roomProxy: RoomProxyProtocol,
|
||||
callBaseURL: URL,
|
||||
clientID: String) {
|
||||
clientID: String,
|
||||
elementCallBaseURL: URL,
|
||||
elementCallBaseURLOverride: URL?) {
|
||||
self.elementCallService = elementCallService
|
||||
self.roomProxy = roomProxy
|
||||
|
||||
@@ -90,7 +92,15 @@ class CallScreenViewModel: CallScreenViewModelType, CallScreenViewModelProtocol
|
||||
.store(in: &cancellables)
|
||||
|
||||
Task {
|
||||
switch await widgetDriver.start(baseURL: callBaseURL, clientID: clientID) {
|
||||
let baseURL = if let elementCallBaseURLOverride {
|
||||
elementCallBaseURLOverride
|
||||
} else if case .success(let wellKnown) = await clientProxy.getElementWellKnown(), let wellKnownCall = wellKnown?.call {
|
||||
wellKnownCall.widgetURL
|
||||
} else {
|
||||
elementCallBaseURL
|
||||
}
|
||||
|
||||
switch await widgetDriver.start(baseURL: baseURL, clientID: clientID) {
|
||||
case .success(let url):
|
||||
state.url = url
|
||||
case .failure(let error):
|
||||
|
||||
Reference in New Issue
Block a user