diff --git a/crates/core/models/src/v0/messages.rs b/crates/core/models/src/v0/messages.rs index 435c3bc4..90dc39fc 100644 --- a/crates/core/models/src/v0/messages.rs +++ b/crates/core/models/src/v0/messages.rs @@ -98,17 +98,19 @@ auto_derived!( /// Name and / or avatar override information #[cfg_attr(feature = "validator", derive(Validate))] pub struct Masquerade { - // FIXME: missing validation /// Replace the display name shown on this message #[serde(skip_serializing_if = "Option::is_none")] + #[validate(length(min = 1, max = 32))] pub name: Option, /// Replace the avatar shown on this message (URL to image file) #[serde(skip_serializing_if = "Option::is_none")] + #[validate(length(min = 1, max = 256))] pub avatar: Option, /// Replace the display role colour shown on this message /// /// Must have `ManageRole` permission to use #[serde(skip_serializing_if = "Option::is_none")] + #[validate(length(min = 1, max = 128), regex = "RE_COLOUR")] pub colour: Option, }