diff --git a/matrix_sdk/src/client.rs b/matrix_sdk/src/client.rs index a8b00ca9..baef0a44 100644 --- a/matrix_sdk/src/client.rs +++ b/matrix_sdk/src/client.rs @@ -41,7 +41,8 @@ use tracing::{error, info, instrument}; use matrix_sdk_base::{ deserialized_responses::{MembersResponse, SyncResponse}, - BaseClient, BaseClientConfig, EventHandler, InvitedRoom, JoinedRoom, LeftRoom, Session, Store, + BaseClient, BaseClientConfig, EventHandler, InvitedRoom, JoinedRoom, LeftRoom, RoomState, + Session, Store, }; #[cfg(feature = "encryption")] @@ -560,6 +561,13 @@ impl Client { self.base_client.set_event_handler(handler).await; } + /// Get all the rooms the client knows about. + /// + /// This will return the list of joined, invited, and left rooms. + pub fn rooms(&self) -> Vec { + self.store().get_rooms() + } + /// Returns the joined rooms this client knows about. pub fn joined_rooms(&self) -> Vec { self.store()