From 0d72acd5e90ec2de03747a860a320b64071422b9 Mon Sep 17 00:00:00 2001 From: Jonas Platte Date: Tue, 5 Mar 2024 08:47:11 +0100 Subject: [PATCH] events: Improve media event content formatted field docs --- crates/ruma-events/src/room/message/audio.rs | 4 +++- crates/ruma-events/src/room/message/file.rs | 4 +++- crates/ruma-events/src/room/message/image.rs | 4 +++- crates/ruma-events/src/room/message/video.rs | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/crates/ruma-events/src/room/message/audio.rs b/crates/ruma-events/src/room/message/audio.rs index 4ee49ede..c9c9a237 100644 --- a/crates/ruma-events/src/room/message/audio.rs +++ b/crates/ruma-events/src/room/message/audio.rs @@ -18,7 +18,9 @@ pub struct AudioMessageEventContent { /// uploaded file. Otherwise, this should be interpreted as a user-written media caption. pub body: String, - /// Formatted form of the message `body`, if `body` is a caption. + /// Formatted form of the message `body`. + /// + /// This should only be set if the body represents a caption. #[serde(flatten)] pub formatted: Option, diff --git a/crates/ruma-events/src/room/message/file.rs b/crates/ruma-events/src/room/message/file.rs index aaca269e..8601bd1a 100644 --- a/crates/ruma-events/src/room/message/file.rs +++ b/crates/ruma-events/src/room/message/file.rs @@ -16,7 +16,9 @@ pub struct FileMessageEventContent { /// uploaded file. Otherwise, this should be interpreted as a user-written media caption. pub body: String, - /// Formatted form of the message `body`, if `body` is a caption. + /// Formatted form of the message `body`. + /// + /// This should only be set if the body represents a caption. #[serde(flatten)] pub formatted: Option, diff --git a/crates/ruma-events/src/room/message/image.rs b/crates/ruma-events/src/room/message/image.rs index 8c7336d2..55c33401 100644 --- a/crates/ruma-events/src/room/message/image.rs +++ b/crates/ruma-events/src/room/message/image.rs @@ -15,7 +15,9 @@ pub struct ImageMessageEventContent { /// uploaded file. Otherwise, this should be interpreted as a user-written media caption. pub body: String, - /// Formatted form of the message `body`, if `body` is a caption. + /// Formatted form of the message `body`. + /// + /// This should only be set if the body represents a caption. #[serde(flatten)] pub formatted: Option, diff --git a/crates/ruma-events/src/room/message/video.rs b/crates/ruma-events/src/room/message/video.rs index 428e9f04..30fd9d55 100644 --- a/crates/ruma-events/src/room/message/video.rs +++ b/crates/ruma-events/src/room/message/video.rs @@ -18,7 +18,9 @@ pub struct VideoMessageEventContent { /// uploaded file. Otherwise, this should be interpreted as a user-written media caption. pub body: String, - /// Formatted form of the message `body`, if `body` is a caption. + /// Formatted form of the message `body`. + /// + /// This should only be set if the body represents a caption. #[serde(flatten)] pub formatted: Option,