mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add SwiftFormat wraparguments (#579)
Matches the wrapparameters rule, seems it was missed.
This commit is contained in:
@@ -80,11 +80,9 @@ private func decodeAC(_ value: Int, maximumValue: Float) -> (Float, Float, Float
|
||||
let quantG = (value / 19) % 19
|
||||
let quantB = value % 19
|
||||
|
||||
let rgb = (
|
||||
signPow((Float(quantR) - 9) / 9, 2) * maximumValue,
|
||||
signPow((Float(quantG) - 9) / 9, 2) * maximumValue,
|
||||
signPow((Float(quantB) - 9) / 9, 2) * maximumValue
|
||||
)
|
||||
let rgb = (signPow((Float(quantR) - 9) / 9, 2) * maximumValue,
|
||||
signPow((Float(quantG) - 9) / 9, 2) * maximumValue,
|
||||
signPow((Float(quantB) - 9) / 9, 2) * maximumValue)
|
||||
|
||||
return rgb
|
||||
}
|
||||
|
||||
@@ -31,39 +31,31 @@ final class UserAgentBuilder {
|
||||
let clientVersion = InfoPlistReader.main.bundleShortVersionString
|
||||
|
||||
#if os(iOS)
|
||||
return String(
|
||||
format: "%@/%@ (%@; iOS %@; Scale/%0.2f)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
Device.current.safeDescription,
|
||||
UIDevice.current.systemVersion,
|
||||
UIScreen.main.scale
|
||||
)
|
||||
return String(format: "%@/%@ (%@; iOS %@; Scale/%0.2f)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
Device.current.safeDescription,
|
||||
UIDevice.current.systemVersion,
|
||||
UIScreen.main.scale)
|
||||
#elseif os(tvOS)
|
||||
return String(
|
||||
format: "%@/%@ (%@; tvOS %@; Scale/%0.2f)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
Device.current.safeDescription,
|
||||
UIDevice.current.systemVersion,
|
||||
UIScreen.main.scale
|
||||
)
|
||||
return String(format: "%@/%@ (%@; tvOS %@; Scale/%0.2f)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
Device.current.safeDescription,
|
||||
UIDevice.current.systemVersion,
|
||||
UIScreen.main.scale)
|
||||
#elseif os(watchOS)
|
||||
return String(
|
||||
format: "%@/%@ (%@; watchOS %@; Scale/%0.2f)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
Device.current.safeDescription,
|
||||
WKInterfaceDevice.current.systemVersion,
|
||||
WKInterfaceDevice.currentDevice.screenScale
|
||||
)
|
||||
return String(format: "%@/%@ (%@; watchOS %@; Scale/%0.2f)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
Device.current.safeDescription,
|
||||
WKInterfaceDevice.current.systemVersion,
|
||||
WKInterfaceDevice.currentDevice.screenScale)
|
||||
#elseif os(OSX)
|
||||
return String(
|
||||
format: "%@/%@ (Mac; Mac OS X %@)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
NSProcessInfo.processInfo.operatingSystemVersionString
|
||||
)
|
||||
return String(format: "%@/%@ (Mac; Mac OS X %@)",
|
||||
clientName,
|
||||
clientVersion,
|
||||
NSProcessInfo.processInfo.operatingSystemVersionString)
|
||||
#else
|
||||
return nil
|
||||
#endif
|
||||
|
||||
@@ -64,15 +64,13 @@ class OIDCService {
|
||||
"policy_uri": "https://element.io/privacy"
|
||||
]
|
||||
|
||||
let nonTemplatizedRequest = OIDRegistrationRequest(
|
||||
configuration: metadata,
|
||||
redirectURIs: [redirectURI],
|
||||
responseTypes: nil,
|
||||
grantTypes: [OIDGrantTypeAuthorizationCode, OIDGrantTypeRefreshToken],
|
||||
subjectType: nil,
|
||||
tokenEndpointAuthMethod: "none",
|
||||
additionalParameters: extraParams
|
||||
)
|
||||
let nonTemplatizedRequest = OIDRegistrationRequest(configuration: metadata,
|
||||
redirectURIs: [redirectURI],
|
||||
responseTypes: nil,
|
||||
grantTypes: [OIDGrantTypeAuthorizationCode, OIDGrantTypeRefreshToken],
|
||||
subjectType: nil,
|
||||
tokenEndpointAuthMethod: "none",
|
||||
additionalParameters: extraParams)
|
||||
|
||||
let registrationResponse = try await OIDAuthorizationService.perform(nonTemplatizedRequest)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user