forked from jmug/stoatchat
feat: add pronouns to user and server members field (#811)
Signed-off-by: İspik <ispik@ispik.dev>
This commit is contained in:
@@ -52,6 +52,9 @@ auto_derived_partial!(
|
||||
/// Member's nickname
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
pub nickname: Option<String>,
|
||||
/// Member's pronouns
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
pub pronouns: Option<String>,
|
||||
/// Avatar attachment
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
pub avatar: Option<File>,
|
||||
@@ -89,6 +92,7 @@ auto_derived!(
|
||||
/// Optional fields on server member object
|
||||
pub enum FieldsMember {
|
||||
Nickname,
|
||||
Pronouns,
|
||||
Avatar,
|
||||
Roles,
|
||||
Timeout,
|
||||
@@ -136,6 +140,9 @@ auto_derived!(
|
||||
/// Member nickname
|
||||
#[cfg_attr(feature = "validator", validate(length(min = 1, max = 32)))]
|
||||
pub nickname: Option<String>,
|
||||
/// Member pronouns
|
||||
#[cfg_attr(feature = "validator", validate(length(min = 1, max = 24)))]
|
||||
pub pronouns: Option<String>,
|
||||
/// Attachment Id to set for avatar
|
||||
pub avatar: Option<String>,
|
||||
/// Array of role ids
|
||||
|
||||
@@ -32,6 +32,9 @@ auto_derived_partial!(
|
||||
/// Display name
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
pub display_name: Option<String>,
|
||||
/// User's pronouns
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
pub pronouns: Option<String>,
|
||||
#[cfg_attr(feature = "serde", serde(skip_serializing_if = "Option::is_none"))]
|
||||
/// Avatar attachment
|
||||
pub avatar: Option<File>,
|
||||
@@ -89,6 +92,7 @@ auto_derived!(
|
||||
ProfileContent,
|
||||
ProfileBackground,
|
||||
DisplayName,
|
||||
Pronouns,
|
||||
|
||||
/// Internal field, ignore this.
|
||||
Internal,
|
||||
@@ -225,6 +229,9 @@ auto_derived!(
|
||||
validate(length(min = 2, max = 32), regex = "RE_DISPLAY_NAME")
|
||||
)]
|
||||
pub display_name: Option<String>,
|
||||
/// New pronouns
|
||||
#[cfg_attr(feature = "validator", validate(length(min = 1, max = 24)))]
|
||||
pub pronouns: Option<String>,
|
||||
/// Attachment Id for avatar
|
||||
#[cfg_attr(feature = "validator", validate(length(min = 1, max = 128)))]
|
||||
pub avatar: Option<String>,
|
||||
|
||||
Reference in New Issue
Block a user