fix: don't send new events from left rooms

This commit is contained in:
Timo Kösters 2020-10-27 20:25:43 +01:00
parent 2f5df4aac9
commit 0762196963
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
6 changed files with 79 additions and 48 deletions

View file

@ -395,6 +395,7 @@ pub async fn upgrade_room_route(
db.rooms
.room_state_get(&body.room_id, &EventType::RoomCreate, "")?
.ok_or_else(|| Error::bad_database("Found room without m.room.create event."))?
.1
.content,
)
.expect("Raw::from_value always works")
@ -470,7 +471,7 @@ pub async fn upgrade_room_route(
// Replicate transferable state events to the new room
for event_type in transferable_state_events {
let event_content = match db.rooms.room_state_get(&body.room_id, &event_type, "")? {
Some(v) => v.content.clone(),
Some((_, v)) => v.content.clone(),
None => continue, // Skipping missing events.
};
@ -502,6 +503,7 @@ pub async fn upgrade_room_route(
db.rooms
.room_state_get(&body.room_id, &EventType::RoomPowerLevels, "")?
.ok_or_else(|| Error::bad_database("Found room without m.room.create event."))?
.1
.content,
)
.expect("database contains invalid PDU")