mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-07 23:44:53 -04:00
feat(base): Implement Client::rooms_stream.
This patch implements `Client::rooms_stream`, which forwards the result of the recently added `Store::rooms_stream` method.
This commit is contained in:
@@ -21,6 +21,8 @@ use std::{
|
||||
use std::{ops::Deref, sync::Arc};
|
||||
|
||||
use eyeball::{SharedObservable, Subscriber};
|
||||
use eyeball_im::{Vector, VectorDiff};
|
||||
use futures_util::Stream;
|
||||
use matrix_sdk_common::instant::Instant;
|
||||
#[cfg(feature = "e2e-encryption")]
|
||||
use matrix_sdk_crypto::{
|
||||
@@ -169,6 +171,11 @@ impl BaseClient {
|
||||
self.store.rooms_filtered(filter)
|
||||
}
|
||||
|
||||
/// Get a stream of all the rooms, in addition to the existing rooms.
|
||||
pub fn rooms_stream(&self) -> (Vector<Room>, impl Stream<Item = Vec<VectorDiff<Room>>>) {
|
||||
self.store.rooms_stream()
|
||||
}
|
||||
|
||||
/// Lookup the Room for the given RoomId, or create one, if it didn't exist
|
||||
/// yet in the store
|
||||
pub fn get_or_create_room(&self, room_id: &RoomId, room_state: RoomState) -> Room {
|
||||
|
||||
Reference in New Issue
Block a user