Upgrade Ruma

This commit is contained in:
Jonas Platte 2021-11-26 20:36:40 +01:00
parent 1fc616320a
commit 892a0525f2
No known key found for this signature in database
GPG key ID: CC154DE0E30B7C67
25 changed files with 297 additions and 304 deletions

View file

@ -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();