From 7fd350d6c60c831a4cee0cb44bb0986001cccb9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Tue, 11 May 2021 09:58:38 +0200 Subject: [PATCH] events: Restore docs for DummyEvent and RoomKeyEvent --- crates/ruma-events/src/dummy.rs | 10 ++++++++++ crates/ruma-events/src/room_key.rs | 2 ++ 2 files changed, 12 insertions(+) diff --git a/crates/ruma-events/src/dummy.rs b/crates/ruma-events/src/dummy.rs index bbe22429..f7f600ed 100644 --- a/crates/ruma-events/src/dummy.rs +++ b/crates/ruma-events/src/dummy.rs @@ -4,6 +4,16 @@ use ruma_events_macros::EventContent; use serde::{Deserialize, Serialize}; /// The payload for `DummyEvent`. +/// +/// This event type is used to indicate new Olm sessions for end-to-end encryption. +/// +/// Typically it is encrypted as an *m.room.encrypted* event, then sent as a to-device event. +/// +/// The event does not have any content associated with it. The sending client is expected to +/// send a key share request shortly after this message, causing the receiving client to process +/// this *m.dummy* event as the most recent event and using the keyshare request to set up the +/// session. The keyshare request and *m.dummy* combination should result in the original +/// sending client receiving keys over the newly established session. #[derive(Clone, Debug, Deserialize, Serialize, EventContent)] #[ruma_event(type = "m.dummy")] pub struct DummyToDeviceEventContent {} diff --git a/crates/ruma-events/src/room_key.rs b/crates/ruma-events/src/room_key.rs index 5e22d308..07ff04b9 100644 --- a/crates/ruma-events/src/room_key.rs +++ b/crates/ruma-events/src/room_key.rs @@ -5,6 +5,8 @@ use ruma_identifiers::{EventEncryptionAlgorithm, RoomId}; use serde::{Deserialize, Serialize}; /// The payload for `RoomKeyEvent`. +/// +/// Typically encrypted as an *m.room.encrypted* event, then sent as a to-device event. #[derive(Clone, Debug, Deserialize, Serialize, EventContent)] #[ruma_event(type = "m.room_key")] pub struct RoomKeyToDeviceEventContent {