Skip to content

Commit

Permalink
fixup! crypto: Expose a way to pin a user's identity
Browse files Browse the repository at this point in the history
Improve comment about pin violation
  • Loading branch information
andybalaam committed Oct 7, 2024
1 parent 562316c commit fddcbdf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions bindings/matrix-sdk-ffi/src/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ impl UserIdentity {
/// method explicitly accepts the new identity, allowing it to replace
/// the previously pinned one and bringing it out of pin violation.
///
/// An identity which is not verified and is in pin violation will require
/// user approval before it can be used.
/// UIs should display a warning to the user when encountering an identity
/// which is not verified and is in pin violation.
pub(crate) async fn pin(&self) -> Result<(), ClientError> {
Ok(self.inner.pin().await?)
}
Expand Down
8 changes: 4 additions & 4 deletions crates/matrix-sdk-crypto/src/identities/user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ impl UserIdentity {
/// method explicitly accepts the new identity, allowing it to replace
/// the previously pinned one and bringing it out of pin violation.
///
/// An identity which is not verified and is in pin violation will require
/// user approval before it can be used. See
/// UIs should display a warning to the user when encountering an identity
/// which is not verified and is in pin violation. See
/// [`OtherUserIdentity::identity_needs_user_approval`].
pub async fn pin(&self) -> Result<(), CryptoStoreError> {
match self {
Expand Down Expand Up @@ -775,8 +775,8 @@ impl OtherUserIdentityData {
/// method explicitly accepts the new identity, allowing it to replace
/// the previously pinned one and bringing it out of pin violation.
///
/// An identity which is not verified and is in pin violation will require
/// user approval before it can be used. See
/// UIs should display a warning to the user when encountering an identity
/// which is not verified and is in pin violation. See
/// [`OtherUserIdentity::identity_needs_user_approval`].
pub(crate) fn pin(&self) {
let mut m = self.pinned_master_key.write().unwrap();
Expand Down
4 changes: 2 additions & 2 deletions crates/matrix-sdk/src/encryption/identities/users.rs
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ impl UserIdentity {
/// method explicitly accepts the new identity, allowing it to replace
/// the previously pinned one and bringing it out of pin violation.
///
/// An identity which is not verified and is in pin violation will require
/// user approval before it can be used.
/// UIs should display a warning to the user when encountering an identity
/// which is not verified and is in pin violation.
pub async fn pin(&self) -> Result<(), CryptoStoreError> {
self.inner.pin().await
}
Expand Down

0 comments on commit fddcbdf

Please sign in to comment.