diff --git a/src/users.rs b/src/users.rs index 3b34b6a..5d9ba41 100644 --- a/src/users.rs +++ b/src/users.rs @@ -65,6 +65,10 @@ pub struct UserDetails { /// A list of external auth identifiers the homeserver has associated with the user. #[serde(default, skip_serializing_if = "Vec::is_empty")] pub external_ids: Vec, + + /// Is the account locked + #[serde(default, deserialize_with = "crate::serde::bool_or_uint")] + pub locked: bool, } /// An external ID associated with a user diff --git a/src/users/create_or_modify/v2.rs b/src/users/create_or_modify/v2.rs index 4178200..2d2d2a1 100644 --- a/src/users/create_or_modify/v2.rs +++ b/src/users/create_or_modify/v2.rs @@ -55,6 +55,12 @@ pub struct Request { /// defaults to false, or the current value if user already exists #[serde(skip_serializing_if = "Option::is_none")] pub deactivated: Option, + + /// Whether the user should be locked. + /// + /// Defaults to false, or the current value if user already exists. + #[serde(skip_serializing_if = "Option::is_none")] + pub locked: Option, } #[response] @@ -89,6 +95,7 @@ impl Request { avatar_url: None, admin: None, deactivated: None, + locked: None, } } } diff --git a/src/users/list_users/v2.rs b/src/users/list_users/v2.rs index 7bc5200..2866524 100644 --- a/src/users/list_users/v2.rs +++ b/src/users/list_users/v2.rs @@ -56,6 +56,13 @@ pub struct Request { #[serde(default, skip_serializing_if = "ruma::serde::is_default")] #[ruma_api(query)] pub deactivated: bool, + + /// Whether to include locked users in the response. + /// + /// Defaults to false to exclude locked users. + #[serde(default, skip_serializing_if = "ruma::serde::is_default")] + #[ruma_api(query)] + pub locked: bool, } #[response] @@ -116,4 +123,8 @@ pub struct UserMinorDetails { /// The user's avatar URL, if set. #[serde(skip_serializing_if = "Option::is_none")] pub avatar_url: Option, + + /// Whether the account is locked. + #[serde(default, deserialize_with = "crate::serde::bool_or_uint")] + pub locked: bool, }