mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Session verification fixes and bump SDK to v0.0.1-october23 (#1954)
* Fixes vector-im/element-x-ios/issues/1868 Incorrect `is_verified` flag after successfully running verification flow - the inner user_identity isn't automatically updated when the flow finishes, needs to be fetched again from encryption - also replaces `UserIdentity.is_verified` with `Device.is_cross_signed_by_owner` - depends on matrix-org/matrix-rust-sdk/pull/2775 --------- Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
@@ -2704,12 +2704,24 @@ class SessionVerificationControllerProxyMock: SessionVerificationControllerProxy
|
||||
set(value) { underlyingCallbacks = value }
|
||||
}
|
||||
var underlyingCallbacks: PassthroughSubject<SessionVerificationControllerProxyCallback, Never>!
|
||||
var isVerified: Bool {
|
||||
get { return underlyingIsVerified }
|
||||
set(value) { underlyingIsVerified = value }
|
||||
}
|
||||
var underlyingIsVerified: Bool!
|
||||
|
||||
//MARK: - isVerified
|
||||
|
||||
var isVerifiedCallsCount = 0
|
||||
var isVerifiedCalled: Bool {
|
||||
return isVerifiedCallsCount > 0
|
||||
}
|
||||
var isVerifiedReturnValue: Result<Bool, SessionVerificationControllerProxyError>!
|
||||
var isVerifiedClosure: (() async -> Result<Bool, SessionVerificationControllerProxyError>)?
|
||||
|
||||
func isVerified() async -> Result<Bool, SessionVerificationControllerProxyError> {
|
||||
isVerifiedCallsCount += 1
|
||||
if let isVerifiedClosure = isVerifiedClosure {
|
||||
return await isVerifiedClosure()
|
||||
} else {
|
||||
return isVerifiedReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - requestVerification
|
||||
|
||||
var requestVerificationCallsCount = 0
|
||||
|
||||
@@ -165,6 +165,23 @@ class SDKClientMock: SDKClientProtocol {
|
||||
return displayNameReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - encryption
|
||||
|
||||
public var encryptionCallsCount = 0
|
||||
public var encryptionCalled: Bool {
|
||||
return encryptionCallsCount > 0
|
||||
}
|
||||
public var encryptionReturnValue: Encryption!
|
||||
public var encryptionClosure: (() -> Encryption)?
|
||||
|
||||
public func encryption() -> Encryption {
|
||||
encryptionCallsCount += 1
|
||||
if let encryptionClosure = encryptionClosure {
|
||||
return encryptionClosure()
|
||||
} else {
|
||||
return encryptionReturnValue
|
||||
}
|
||||
}
|
||||
//MARK: - getDmRoom
|
||||
|
||||
public var getDmRoomUserIdThrowableError: Error?
|
||||
|
||||
Reference in New Issue
Block a user