Simplify authentication logic

matrix.org now supports MAS so we don't need the web registration helper anymore.
This commit is contained in:
Doug
2025-04-10 15:09:40 +01:00
committed by Doug
parent b2c647b1af
commit 1557054753
32 changed files with 86 additions and 709 deletions
@@ -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