ruwuma/src/room_key.rs
Ragotzy.devin 8ea971b082
Derive Serialize in ruma_events!, use json EventType string for event_type field
Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2020-03-24 14:25:50 +01:00

32 lines
878 B
Rust

//! Types for the *m.room_key* event.
use ruma_events_macros::ruma_event;
use ruma_identifiers::RoomId;
use super::Algorithm;
ruma_event! {
/// This event type is used to exchange keys for end-to-end encryption.
///
/// Typically it is encrypted as an *m.room.encrypted* event, then sent as a to-device event.
RoomKeyEvent {
kind: Event,
event_type: "m.room_key",
content: {
/// The encryption algorithm the key in this event is to be used with.
///
/// Must be `m.megolm.v1.aes-sha2`.
pub algorithm: Algorithm,
/// The room where the key is used.
pub room_id: RoomId,
/// The ID of the session that the key is for.
pub session_id: String,
/// The key to be exchanged.
pub session_key: String,
}
}
}