mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Simplify authentication logic
matrix.org now supports MAS so we don't need the web registration helper anymore.
This commit is contained in:
@@ -4281,70 +4281,6 @@ class ClientProxyMock: ClientProxyProtocol, @unchecked Sendable {
|
||||
return isAliasAvailableReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - getElementWellKnown
|
||||
|
||||
var getElementWellKnownUnderlyingCallsCount = 0
|
||||
var getElementWellKnownCallsCount: Int {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return getElementWellKnownUnderlyingCallsCount
|
||||
} else {
|
||||
var returnValue: Int? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = getElementWellKnownUnderlyingCallsCount
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
getElementWellKnownUnderlyingCallsCount = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
getElementWellKnownUnderlyingCallsCount = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var getElementWellKnownCalled: Bool {
|
||||
return getElementWellKnownCallsCount > 0
|
||||
}
|
||||
|
||||
var getElementWellKnownUnderlyingReturnValue: Result<ElementWellKnown?, ClientProxyError>!
|
||||
var getElementWellKnownReturnValue: Result<ElementWellKnown?, ClientProxyError>! {
|
||||
get {
|
||||
if Thread.isMainThread {
|
||||
return getElementWellKnownUnderlyingReturnValue
|
||||
} else {
|
||||
var returnValue: Result<ElementWellKnown?, ClientProxyError>? = nil
|
||||
DispatchQueue.main.sync {
|
||||
returnValue = getElementWellKnownUnderlyingReturnValue
|
||||
}
|
||||
|
||||
return returnValue!
|
||||
}
|
||||
}
|
||||
set {
|
||||
if Thread.isMainThread {
|
||||
getElementWellKnownUnderlyingReturnValue = newValue
|
||||
} else {
|
||||
DispatchQueue.main.sync {
|
||||
getElementWellKnownUnderlyingReturnValue = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var getElementWellKnownClosure: (() async -> Result<ElementWellKnown?, ClientProxyError>)?
|
||||
|
||||
func getElementWellKnown() async -> Result<ElementWellKnown?, ClientProxyError> {
|
||||
getElementWellKnownCallsCount += 1
|
||||
if let getElementWellKnownClosure = getElementWellKnownClosure {
|
||||
return await getElementWellKnownClosure()
|
||||
} else {
|
||||
return getElementWellKnownReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - clearCaches
|
||||
|
||||
var clearCachesUnderlyingCallsCount = 0
|
||||
|
||||
Reference in New Issue
Block a user