Upgrade Ruma
This commit is contained in:
parent
1fc616320a
commit
892a0525f2
25 changed files with 297 additions and 304 deletions
|
@ -1,13 +1,10 @@
|
|||
use std::{
|
||||
convert::{TryFrom, TryInto},
|
||||
sync::Arc,
|
||||
};
|
||||
use std::{convert::TryFrom, sync::Arc};
|
||||
|
||||
use crate::{pdu::PduBuilder, Database};
|
||||
use rocket::futures::{channel::mpsc, stream::StreamExt};
|
||||
use ruma::{
|
||||
events::{room::message::RoomMessageEventContent, EventType},
|
||||
UserId,
|
||||
RoomAliasId, UserId,
|
||||
};
|
||||
use serde_json::value::to_raw_value;
|
||||
use tokio::sync::{MutexGuard, RwLock, RwLockReadGuard};
|
||||
|
@ -37,15 +34,17 @@ impl Admin {
|
|||
let guard = db.read().await;
|
||||
|
||||
let conduit_user =
|
||||
UserId::try_from(format!("@conduit:{}", guard.globals.server_name()))
|
||||
Box::<UserId>::try_from(format!("@conduit:{}", guard.globals.server_name()))
|
||||
.expect("@conduit:server_name is valid");
|
||||
|
||||
let conduit_room = guard
|
||||
.rooms
|
||||
.id_from_alias(
|
||||
&format!("#admins:{}", guard.globals.server_name())
|
||||
.try_into()
|
||||
.expect("#admins:server_name is a valid room alias"),
|
||||
&Box::<RoomAliasId>::try_from(format!(
|
||||
"#admins:{}",
|
||||
guard.globals.server_name()
|
||||
))
|
||||
.expect("#admins:server_name is a valid room alias"),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue