1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-29 22:01:14 +03:00

Save the imported attributes

This commit is contained in:
Quentin Gliech
2023-06-21 18:50:03 +02:00
parent c183830489
commit 31788a95f2
4 changed files with 136 additions and 12 deletions

View File

@ -256,13 +256,30 @@ mod jobs {
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ProvisionUserJob {
user_id: Ulid,
set_display_name: Option<String>,
}
impl ProvisionUserJob {
/// Create a new job to provision the user on the homeserver.
#[must_use]
pub fn new(user: &User) -> Self {
Self { user_id: user.id }
Self {
user_id: user.id,
set_display_name: None,
}
}
/// Set the display name of the user.
#[must_use]
pub fn set_display_name(mut self, display_name: String) -> Self {
self.set_display_name = Some(display_name);
self
}
/// Get the display name to be set.
#[must_use]
pub fn display_name_to_set(&self) -> Option<&str> {
self.set_display_name.as_deref()
}
/// The ID of the user to provision.