mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-08-16 18:01:35 +00:00
PoC
This commit is contained in:
parent
1f313c6807
commit
40699c395a
6 changed files with 88 additions and 5 deletions
|
@ -1,5 +1,8 @@
|
|||
use super::{DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH};
|
||||
use crate::{api::client_server, services, utils, Error, Result, Ruma};
|
||||
use crate::{
|
||||
api::client_server::{self, membership::join_room_by_id_helper},
|
||||
services, utils, Error, Result, Ruma,
|
||||
};
|
||||
use ruma::{
|
||||
api::client::{
|
||||
account::{
|
||||
|
@ -287,6 +290,28 @@ pub async fn register_route(body: Ruma<register::v3::Request>) -> Result<registe
|
|||
warn!("Granting {} admin privileges as the first user", user_id);
|
||||
}
|
||||
}
|
||||
|
||||
let servers = [services().globals.server_name().to_owned()];
|
||||
let join_by_default = services()
|
||||
.globals
|
||||
.join_by_default()
|
||||
.expect("validated on db startup");
|
||||
|
||||
for room_id in join_by_default {
|
||||
join_room_by_id_helper(
|
||||
Some(&user_id),
|
||||
room_id,
|
||||
Some("All men are equal before fish.".to_owned()),
|
||||
&servers,
|
||||
None,
|
||||
)
|
||||
.await
|
||||
.map_err(|e| {
|
||||
tracing::error!("join_by_default: {}", e);
|
||||
|
||||
Error::bad_config("join_by_default.")
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(register::v3::Response {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue