mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-09 16:34:32 -04:00
refactor(event cache): remove unused impl of PaginableRoom for WeakRoom
This commit is contained in:
@@ -25,7 +25,7 @@ use ruma::{api::Direction, EventId, OwnedEventId, UInt};
|
||||
|
||||
use super::pagination::PaginationToken;
|
||||
use crate::{
|
||||
room::{EventWithContextResponse, Messages, MessagesOptions, WeakRoom},
|
||||
room::{EventWithContextResponse, Messages, MessagesOptions},
|
||||
Room,
|
||||
};
|
||||
|
||||
@@ -453,31 +453,6 @@ impl PaginableRoom for Room {
|
||||
}
|
||||
}
|
||||
|
||||
impl PaginableRoom for WeakRoom {
|
||||
async fn event_with_context(
|
||||
&self,
|
||||
event_id: &EventId,
|
||||
lazy_load_members: bool,
|
||||
num_events: UInt,
|
||||
) -> Result<EventWithContextResponse, PaginatorError> {
|
||||
let Some(room) = self.get() else {
|
||||
// Client is shutting down, return a default response.
|
||||
return Ok(EventWithContextResponse::default());
|
||||
};
|
||||
|
||||
PaginableRoom::event_with_context(&room, event_id, lazy_load_members, num_events).await
|
||||
}
|
||||
|
||||
async fn messages(&self, opts: MessagesOptions) -> Result<Messages, PaginatorError> {
|
||||
let Some(room) = self.get() else {
|
||||
// Client is shutting down, return a default response.
|
||||
return Ok(Messages::default());
|
||||
};
|
||||
|
||||
PaginableRoom::messages(&room, opts).await
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(not(target_family = "wasm"), test))]
|
||||
mod tests {
|
||||
use std::sync::Arc;
|
||||
|
||||
Reference in New Issue
Block a user