ffi: Add wait_for_token to PaginationOptions
This commit is contained in:
parent
af870fcff3
commit
87510a5bc2
|
@ -139,8 +139,8 @@ dictionary MoveData {
|
|||
|
||||
[Enum]
|
||||
interface PaginationOptions {
|
||||
SingleRequest(u16 event_limit);
|
||||
UntilNumItems(u16 event_limit, u16 items);
|
||||
SingleRequest(u16 event_limit, boolean wait_for_token);
|
||||
UntilNumItems(u16 event_limit, u16 items, boolean wait_for_token);
|
||||
};
|
||||
|
||||
interface RoomMessageEventContent {};
|
||||
|
|
|
@ -826,18 +826,26 @@ impl Room {
|
|||
}
|
||||
|
||||
pub enum PaginationOptions {
|
||||
SingleRequest { event_limit: u16 },
|
||||
UntilNumItems { event_limit: u16, items: u16 },
|
||||
SingleRequest { event_limit: u16, wait_for_token: bool },
|
||||
UntilNumItems { event_limit: u16, items: u16, wait_for_token: bool },
|
||||
}
|
||||
|
||||
impl From<PaginationOptions> for matrix_sdk_ui::timeline::PaginationOptions<'static> {
|
||||
fn from(value: PaginationOptions) -> Self {
|
||||
use matrix_sdk_ui::timeline::PaginationOptions as Opts;
|
||||
match value {
|
||||
PaginationOptions::SingleRequest { event_limit } => Opts::single_request(event_limit),
|
||||
PaginationOptions::UntilNumItems { event_limit, items } => {
|
||||
Opts::until_num_items(event_limit, items)
|
||||
let (wait_for_token, mut opts) = match value {
|
||||
PaginationOptions::SingleRequest { event_limit, wait_for_token } => {
|
||||
(wait_for_token, Opts::single_request(event_limit))
|
||||
}
|
||||
PaginationOptions::UntilNumItems { event_limit, items, wait_for_token } => {
|
||||
(wait_for_token, Opts::until_num_items(event_limit, items))
|
||||
}
|
||||
};
|
||||
|
||||
if wait_for_token {
|
||||
opts = opts.wait_for_token();
|
||||
}
|
||||
|
||||
opts
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue