chore: update ruma again

This commit is contained in:
Timo Kösters 2021-07-20 15:24:18 +02:00
parent 0f8ecdc625
commit f0ac7ed933
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
6 changed files with 35 additions and 39 deletions

View file

@ -20,12 +20,12 @@ use ruma::{
},
events::{
room::{
canonical_alias, guest_access, history_visibility, join_rules, member, message,
name::{self, RoomName},
canonical_alias, guest_access, history_visibility, join_rules, member, message, name,
topic,
},
EventType,
},
identifiers::RoomName,
push, RoomAliasId, RoomId, RoomVersionId, UserId,
};
@ -378,13 +378,14 @@ pub async fn register_route(
)?;
// 6. Events implied by name and topic
let room_name =
Box::<RoomName>::try_from(format!("{} Admin Room", db.globals.server_name()))
.expect("Room name is valid");
db.rooms.build_and_append_pdu(
PduBuilder {
event_type: EventType::RoomName,
content: serde_json::to_value(name::NameEventContent::new(Some(
RoomName::try_from("Admin Room".to_owned()).expect("Room name is valid"),
)))
.expect("event is valid, we just created it"),
content: serde_json::to_value(name::NameEventContent::new(Some(room_name)))
.expect("event is valid, we just created it"),
unsigned: None,
state_key: Some("".to_owned()),
redacts: None,