Restructure full_register arguments with names and defaults.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-12-23 02:50:56 +00:00
parent 5b0dfaeef6
commit 4150b917d8
5 changed files with 58 additions and 16 deletions

View File

@@ -17,7 +17,7 @@ use tuwunel_core::{
matrix::{Event, pdu::PduBuilder},
utils::{self, ReadyExt},
};
use tuwunel_service::Services;
use tuwunel_service::{Services, users::Register};
use crate::{
admin_command, get_room_info,
@@ -63,7 +63,12 @@ pub(super) async fn create_user(&self, username: String, password: Option<String
self.services
.users
.full_register(&user_id, Some(&password), None, None, false, true)
.full_register(Register {
user_id: Some(&user_id),
password: Some(&password),
grant_first_user_admin: true,
..Default::default()
})
.await?;
self.write_str(&format!("Created user with user_id: {user_id} and password: `{password}`"))