This commit is contained in:
Ivan Enderlin
2023-05-24 11:15:39 +02:00
parent 5f58438389
commit 7706b0096b
2 changed files with 34 additions and 1 deletions

View File

@@ -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"]

View File

@@ -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
}
}