matrix_sdk/sliding_sync/list/
sticky.rsuse matrix_sdk_base::sliding_sync::http;
use ruma::events::StateEventType;
use crate::sliding_sync::sticky_parameters::StickyData;
#[derive(Debug)]
pub(super) struct SlidingSyncListStickyParameters {
required_state: Vec<(StateEventType, String)>,
include_heroes: Option<bool>,
filters: Option<http::request::ListFilters>,
}
impl SlidingSyncListStickyParameters {
pub fn new(
required_state: Vec<(StateEventType, String)>,
include_heroes: Option<bool>,
filters: Option<http::request::ListFilters>,
) -> Self {
Self { required_state, include_heroes, filters }
}
}
impl StickyData for SlidingSyncListStickyParameters {
type Request = http::request::List;
fn apply(&self, request: &mut Self::Request) {
request.room_details.required_state = self.required_state.to_vec();
request.include_heroes = self.include_heroes;
request.filters = self.filters.clone();
}
}