fix: don't send new events from left rooms
This commit is contained in:
parent
2f5df4aac9
commit
0762196963
6 changed files with 79 additions and 48 deletions
|
@ -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")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue