Configured and applied SwiftFormat

This commit is contained in:
Stefan Ceriu
2022-09-27 10:17:22 +03:00
committed by Stefan Ceriu
parent ff2e6ddfa7
commit 43c28d23b7
663 changed files with 2329 additions and 2840 deletions
@@ -1,4 +1,4 @@
//
//
// Copyright 2021 New Vector Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -39,7 +39,6 @@ protocol AuthenticationServiceDelegate: AnyObject {
@objcMembers
class AuthenticationService: NSObject {
/// The shared service object.
static let shared = AuthenticationService()
@@ -97,7 +96,7 @@ class AuthenticationService: NSObject {
let hsUrl = universalLink.homeserverUrl
let isUrl = universalLink.identityServerUrl
if hsUrl == nil && isUrl == nil {
if hsUrl == nil, isUrl == nil {
MXLog.debug("[AuthenticationService] handleServerProvisioningLink: no hsUrl or isUrl")
return false
}
@@ -166,7 +165,7 @@ class AuthenticationService: NSObject {
// The state and client are set after trying the registration flow to
// ensure the existing state isn't wiped out when an error occurs.
self.state = AuthenticationState(flow: flow, homeserver: homeserver)
state = AuthenticationState(flow: flow, homeserver: homeserver)
self.client = client
}
@@ -200,9 +199,9 @@ class AuthenticationService: NSObject {
// completeness revert to the default homeserver if requested anyway.
let address = useDefaultServer ? BuildSettings.serverConfigDefaultHomeserverUrlString : state.homeserver.addressFromUser ?? state.homeserver.address
let identityServer = state.identityServer
self.state = AuthenticationState(flow: .login,
homeserverAddress: address,
identityServer: identityServer)
state = AuthenticationState(flow: .login,
homeserverAddress: address,
identityServer: identityServer)
}
/// Continues an SSO flow when completion comes via a deep link.
@@ -289,7 +288,7 @@ class AuthenticationService: NSObject {
let identityProviders = loginFlowResponse.flows?.compactMap { $0 as? MXLoginSSOFlow }.first?.identityProviders ?? []
return LoginFlowResult(supportedLoginTypes: loginFlowResponse.flows?.compactMap { $0 } ?? [],
ssoIdentityProviders: identityProviders.sorted { $0.name < $1.name }.map { $0.ssoIdentityProvider },
ssoIdentityProviders: identityProviders.sorted { $0.name < $1.name }.map(\.ssoIdentityProvider),
homeserverAddress: client.homeserver)
}