mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Fixes element-hq/element-meta/issues/2525 - Display a warning when a user's pinned identity changes
This commit is contained in:
@@ -895,6 +895,22 @@ class ClientProxy: ClientProxyProtocol {
|
||||
await client.encryption().curve25519Key()
|
||||
}
|
||||
|
||||
func pinUserIdentity(_ userID: String) async -> Result<Void, ClientProxyError> {
|
||||
MXLog.info("Pinning current identity for user: \(userID)")
|
||||
|
||||
do {
|
||||
guard let userIdentity = try await client.encryption().getUserIdentity(userId: userID) else {
|
||||
MXLog.error("Failed retrieving identity for user: \(userID)")
|
||||
return .failure(.failedRetrievingUserIdentity)
|
||||
}
|
||||
|
||||
return try await .success(userIdentity.pin())
|
||||
} catch {
|
||||
MXLog.error("Failed pinning current identity 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