diff --git a/crates/ruma-common/src/events/kinds.rs b/crates/ruma-common/src/events/kinds.rs index 1ce56dfc..6d92fb6e 100644 --- a/crates/ruma-common/src/events/kinds.rs +++ b/crates/ruma-common/src/events/kinds.rs @@ -314,6 +314,19 @@ pub struct InitialStateEvent { pub state_key: C::StateKey, } +impl Serialize for InitialStateEvent { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + let mut state = serializer.serialize_struct("InitialStateEvent", 3)?; + state.serialize_field("type", &self.content.event_type())?; + state.serialize_field("content", &self.content)?; + state.serialize_field("state_key", &self.state_key)?; + state.end() + } +} + /// A redacted state event. /// /// `RedactedStateEvent` implements the comparison traits using only the `event_id` field, a sorted