diff --git a/src/euph/api/types.rs b/src/euph/api/types.rs index 8acc64b..f56f0a1 100644 --- a/src/euph/api/types.rs +++ b/src/euph/api/types.rs @@ -39,9 +39,11 @@ pub struct Message { /// The id of the message (unique within a room). pub id: Snowflake, /// The id of the message's parent, or null if top-level. + #[serde(skip_serializing_if = "Option::is_none")] pub parent: Option, /// The edit id of the most recent edit of this message, or null if it's /// never been edited. + #[serde(skip_serializing_if = "Option::is_none")] pub previous_edit_id: Option, /// The unix timestamp of when the message was posted. pub time: Time, @@ -50,15 +52,18 @@ pub struct Message { /// The content of the message (client-defined). pub content: String, /// The id of the key that encrypts the message in storage. + #[serde(skip_serializing_if = "Option::is_none")] pub encryption_key_id: Option, /// The unix timestamp of when the message was last edited. + #[serde(skip_serializing_if = "Option::is_none")] pub edited: Option