`RoomList` API: enable `account_data` extension by default
`RoomList` API: enable `account_data` extension by default
This commit is contained in:
commit
a2cefedf73
|
@ -74,7 +74,7 @@ use matrix_sdk::{
|
|||
SlidingSyncMode, SlidingSyncRoom,
|
||||
};
|
||||
use once_cell::sync::Lazy;
|
||||
use ruma::{OwnedRoomId, RoomId};
|
||||
use ruma::{api::client::sync::sync_events::v4::AccountDataConfig, assign, OwnedRoomId, RoomId};
|
||||
use thiserror::Error;
|
||||
|
||||
use crate::{timeline::EventTimelineItem, Timeline};
|
||||
|
@ -100,13 +100,17 @@ impl RoomList {
|
|||
.map_err(Error::SlidingSync)?
|
||||
.enable_caching()
|
||||
.map_err(Error::SlidingSync)?
|
||||
.add_cached_list(
|
||||
// Enable the account data extension.
|
||||
.with_account_data_extension(
|
||||
assign! { AccountDataConfig::default(), { enabled: Some(true) }},
|
||||
)
|
||||
// TODO revert to `add_cached_list` when reloading rooms from the cache is blazingly
|
||||
// fast
|
||||
.add_list(
|
||||
SlidingSyncList::builder(ALL_ROOMS_LIST_NAME)
|
||||
.sync_mode(SlidingSyncMode::new_selective().add_range(0..=19))
|
||||
.timeline_limit(1),
|
||||
)
|
||||
.await
|
||||
.map_err(Error::SlidingSync)?
|
||||
.build()
|
||||
.await
|
||||
.map_err(Error::SlidingSync)?;
|
||||
|
|
|
@ -252,6 +252,9 @@ async fn test_sync_from_init_to_enjoy() -> Result<(), Error> {
|
|||
"to_device": {
|
||||
"enabled": true,
|
||||
},
|
||||
"account_data": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
},
|
||||
respond with = {
|
||||
|
|
Loading…
Reference in New Issue