Mark EncryptionEventContent as non_exhaustive
This commit is contained in:
parent
34e89f4d11
commit
b31a6eac65
@ -11,6 +11,7 @@ pub type EncryptionEvent = StateEvent<EncryptionEventContent>;
|
||||
|
||||
/// The payload for `EncryptionEvent`.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)]
|
||||
#[non_exhaustive]
|
||||
#[ruma_event(type = "m.room.encryption")]
|
||||
pub struct EncryptionEventContent {
|
||||
/// The encryption algorithm to be used to encrypt messages sent in this room.
|
||||
@ -30,3 +31,10 @@ pub struct EncryptionEventContent {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub rotation_period_msgs: Option<UInt>,
|
||||
}
|
||||
|
||||
impl EncryptionEventContent {
|
||||
/// Creates a new `EncryptionEventContent` with the given algorithm.
|
||||
pub fn new(algorithm: Algorithm) -> Self {
|
||||
Self { algorithm, rotation_period_ms: None, rotation_period_msgs: None }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user