mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
Avoid doubling error display on Jitsi get well known failure
This commit is contained in:
@@ -143,32 +143,31 @@ final class JitsiService: NSObject {
|
||||
}
|
||||
|
||||
return self.getWellKnown(for: jitsiServerURL) { (result) in
|
||||
var continueOperation: Bool = false
|
||||
var authType: JitsiAuthenticationType?
|
||||
|
||||
func continueOperation(authType: JitsiAuthenticationType?) {
|
||||
guard let widgetContent = self.createJitsiWidgetContent(serverDomain: serverDomain,
|
||||
authenticationType: authType,
|
||||
roomID: roomID,
|
||||
isAudioOnly: isAudioOnly)
|
||||
else {
|
||||
failure(JitsiServiceError.widgetContentCreationFailed)
|
||||
return
|
||||
}
|
||||
|
||||
success(widgetContent)
|
||||
}
|
||||
|
||||
switch result {
|
||||
case .success(let jitsiWellKnown):
|
||||
authType = jitsiWellKnown.authenticationType
|
||||
continueOperation = true
|
||||
continueOperation(authType: jitsiWellKnown.authenticationType)
|
||||
case .failure(let error):
|
||||
MXLog.debug("[JitsiService] Fail to get Jitsi Well Known with error: \(error)")
|
||||
if let error = error as? JitsiServiceError, error == .noWellKnown {
|
||||
// no well-known, continue with no auth
|
||||
continueOperation = true
|
||||
continueOperation(authType: nil)
|
||||
} else {
|
||||
failure(error)
|
||||
}
|
||||
}
|
||||
|
||||
if continueOperation,
|
||||
let widgetContent = self.createJitsiWidgetContent(serverDomain: serverDomain,
|
||||
authenticationType: authType,
|
||||
roomID: roomID,
|
||||
isAudioOnly: isAudioOnly) {
|
||||
success(widgetContent)
|
||||
} else {
|
||||
failure(JitsiServiceError.widgetContentCreationFailed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user