diff --git a/src/async_client.rs b/src/async_client.rs index 7819fd0e..3aad1bee 100644 --- a/src/async_client.rs +++ b/src/async_client.rs @@ -400,7 +400,7 @@ impl AsyncClient { } } - client.joined_rooms.get(&room_id).unwrap().clone() + client.get_or_create_room(&room_id).clone() }; for event in &room.timeline.events { diff --git a/src/base_client.rs b/src/base_client.rs index eac2c2f9..8813ecef 100644 --- a/src/base_client.rs +++ b/src/base_client.rs @@ -250,7 +250,7 @@ impl Client { Ok(()) } - fn get_or_create_room(&mut self, room_id: &str) -> &mut Arc> { + pub(crate) fn get_or_create_room(&mut self, room_id: &str) -> &mut Arc> { #[allow(clippy::or_fun_call)] self.joined_rooms .entry(room_id.to_string())