common: Enhance MessageType docs

This commit is contained in:
Johannes Becker 2022-03-07 14:35:55 +01:00 committed by GitHub
parent ed36ae5ac7
commit e94e0e885d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -221,7 +221,11 @@ pub enum MessageType {
} }
impl 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 /// 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 /// be used for unsupported message types only and does not allow setting arbitrary data for