mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:31:27 +00:00
Warn and block sending on verification violation (#3679)
* feat(crypto): Warn and block sending on verification violation * fixup: Fix ComposerToolbar previews * fixup! add ComposerToolBarViewModelTests for canSend * add new preview tests for verification violations * Use `deferFulfillment`s in the unit tests. --------- Co-authored-by: Stefan Ceriu <stefanc@matrix.org>
This commit is contained in:
@@ -1005,6 +1005,22 @@ class ClientProxy: ClientProxyProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
func withdrawUserIdentityVerification(_ userID: String) async -> Result<Void, ClientProxyError> {
|
||||
MXLog.info("Withdrawing current identity verification for user: \(userID)")
|
||||
|
||||
do {
|
||||
guard let userIdentity = try await client.encryption().userIdentity(userId: userID) else {
|
||||
MXLog.error("Failed retrieving identity for user: \(userID)")
|
||||
return .failure(.failedRetrievingUserIdentity)
|
||||
}
|
||||
|
||||
return try await .success(userIdentity.withdrawVerification())
|
||||
} catch {
|
||||
MXLog.error("Failed withdrawing current identity verification for user: \(error)")
|
||||
return .failure(.sdkError(error))
|
||||
}
|
||||
}
|
||||
|
||||
func resetIdentity() async -> Result<IdentityResetHandle?, ClientProxyError> {
|
||||
do {
|
||||
return try await .success(client.encryption().resetIdentity())
|
||||
|
||||
Reference in New Issue
Block a user