diff --git a/matrix_sdk_base/src/client.rs b/matrix_sdk_base/src/client.rs index fff874fe..6c34912f 100644 --- a/matrix_sdk_base/src/client.rs +++ b/matrix_sdk_base/src/client.rs @@ -821,6 +821,7 @@ impl BaseClient { .handle_room_account_data(&room_id, &new_info.account_data.events, &mut changes) .await; + changes.add_room(room_info); rooms .leave .insert(room_id, LeftRoom::new(timeline, state, account_data)); @@ -845,6 +846,7 @@ impl BaseClient { changes.stripped_members.insert(room_id.clone(), members); changes.stripped_state.insert(room_id.clone(), state_events); + changes.add_stripped_room(room_info); let room = InvitedRoom { invite_state: state, diff --git a/matrix_sdk_base/src/store/mod.rs b/matrix_sdk_base/src/store/mod.rs index 9cb24673..76787a97 100644 --- a/matrix_sdk_base/src/store/mod.rs +++ b/matrix_sdk_base/src/store/mod.rs @@ -28,7 +28,7 @@ use matrix_sdk_common::{ use crate::{ deserialized_responses::{MemberEvent, StrippedMemberEvent}, - rooms::{RoomInfo, RoomType, StrippedRoom}, + rooms::{RoomInfo, RoomType, StrippedRoom, StrippedRoomInfo}, InvitedRoom, JoinedRoom, LeftRoom, Room, RoomState, Session, }; @@ -231,7 +231,7 @@ pub struct StateChanges { pub stripped_state: BTreeMap>>, pub stripped_members: BTreeMap>, - pub invited_room_info: BTreeMap, + pub invited_room_info: BTreeMap, } impl StateChanges { @@ -251,6 +251,11 @@ impl StateChanges { .insert(room.room_id.as_ref().to_owned(), room); } + pub fn add_stripped_room(&mut self, room: StrippedRoomInfo) { + self.invited_room_info + .insert(room.room_id.as_ref().to_owned(), room); + } + pub fn add_account_data(&mut self, event: AnyBasicEvent) { self.account_data .insert(event.content().event_type().to_owned(), event);