From e94e0e885d3ea5f2b12480f0984163b975336324 Mon Sep 17 00:00:00 2001 From: Johannes Becker <66059836+johannescpk@users.noreply.github.com> Date: Mon, 7 Mar 2022 14:35:55 +0100 Subject: [PATCH] common: Enhance MessageType docs --- crates/ruma-common/src/events/room/message.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/ruma-common/src/events/room/message.rs b/crates/ruma-common/src/events/room/message.rs index ea585753..eaea2c60 100644 --- a/crates/ruma-common/src/events/room/message.rs +++ b/crates/ruma-common/src/events/room/message.rs @@ -221,7 +221,11 @@ pub enum MessageType { } impl MessageType { - /// Creates a new `MessageType` with the given `msgtype` string and data. + /// Creates a new `MessageType`. + /// + /// The `msgtype` and `body` are required fields as defined by [the `m.room.message` spec](https://spec.matrix.org/v1.2/client-server-api/#mroommessage). + /// Additionally it's possible to add arbitrary key/value pairs to the event content for custom + /// events through the `data` map. /// /// Prefer to use the public variants of `MessageType` where possible; this constructor is meant /// be used for unsupported message types only and does not allow setting arbitrary data for