Merge pull request #621 from matrix-org/dkasak/doc-improvements2

Document `OlmDecryptionInfo` and make it `pub(crate)`.
This commit is contained in:
Denis Kasak
2022-04-28 14:35:32 +00:00
committed by GitHub
2 changed files with 9 additions and 8 deletions

View File

@@ -741,11 +741,7 @@ impl OlmMachine {
///
/// # Arguments
///
/// * `sender_key` - The sender (curve25519) key of the event sender.
///
/// * `signing_key` - The signing (ed25519) key of the event sender.
///
/// * `event` - The decrypted to-device event.
/// * `decrypted` - The decrypted event and some associated metadata.
async fn handle_decrypted_to_device_event(
&self,
decrypted: &OlmDecryptionInfo,

View File

@@ -90,8 +90,13 @@ impl SessionType {
}
}
/// A struct witnessing a successful decryption of an Olm-encrypted to-device
/// event.
///
/// Contains the decrypted event plaintext along with some associated metadata,
/// such as the identity (Curve25519) key of the to-device event sender.
#[derive(Debug, Clone)]
pub struct OlmDecryptionInfo {
pub(crate) struct OlmDecryptionInfo {
pub sender: OwnedUserId,
pub session: SessionType,
pub message_hash: OlmMessageHash,
@@ -213,7 +218,7 @@ impl Account {
}
}
pub async fn decrypt_to_device_event(
pub(crate) async fn decrypt_to_device_event(
&self,
event: &ToDeviceRoomEncryptedEvent,
) -> OlmResult<OlmDecryptionInfo> {
@@ -1005,7 +1010,7 @@ impl ReadOnlyAccount {
/// session failed.
///
/// # Arguments
/// * `their_identity_key` - The other account's identitiy/curve25519 key.
/// * `their_identity_key` - The other account's identity/curve25519 key.
///
/// * `message` - A pre-key Olm message that was sent to us by the other
/// account.