mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-19 06:04:31 -04:00
!foo
This commit is contained in:
@@ -4,7 +4,7 @@ version = "0.6.0"
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
default = ["e2e-encryption", "native-tls"]
|
||||
default = ["e2e-encryption", "native-tls", "experimental-roomlist"]
|
||||
|
||||
e2e-encryption = ["matrix-sdk/e2e-encryption"]
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
//! `RoomList` API.
|
||||
|
||||
use matrix_sdk::{Client, Result, SlidingSync, SlidingSyncList};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct RoomList {
|
||||
sliding_sync: SlidingSync,
|
||||
}
|
||||
|
||||
impl RoomList {
|
||||
pub async fn new(client: Client) -> Result<Self> {
|
||||
Ok(Self {
|
||||
sliding_sync: client
|
||||
.sliding_sync()
|
||||
.storage_key(Some("matrix-sdk-ui-roomlist".to_string()))
|
||||
.add_cached_list(SlidingSyncList::builder("all_rooms"))
|
||||
.await?
|
||||
.add_list(SlidingSyncList::builder("visible_rooms"))
|
||||
.build()
|
||||
.await?,
|
||||
})
|
||||
}
|
||||
|
||||
pub fn sync(&self) {}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[tokio::test]
|
||||
async fn test_has_two_lists() {
|
||||
// let
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user