continuwuity/src/service/rooms/outlier/mod.rs
strawberry 17d0c869b0 remove some various unused functions and mark some possibly important ones *for now*
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-04-26 02:03:40 -04:00

31 lines
829 B
Rust

mod data;
pub(crate) use data::Data;
use ruma::{CanonicalJsonObject, EventId};
use crate::{PduEvent, Result};
pub(crate) struct Service {
pub(crate) db: &'static dyn Data,
}
impl Service {
/// Returns the pdu from the outlier tree.
pub(crate) fn get_outlier_pdu_json(&self, event_id: &EventId) -> Result<Option<CanonicalJsonObject>> {
self.db.get_outlier_pdu_json(event_id)
}
/// Returns the pdu from the outlier tree.
///
/// TODO: use this?
#[allow(dead_code)]
pub(crate) fn get_pdu_outlier(&self, event_id: &EventId) -> Result<Option<PduEvent>> {
self.db.get_outlier_pdu(event_id)
}
/// Append the PDU as an outlier.
#[tracing::instrument(skip(self, pdu))]
pub(crate) fn add_pdu_outlier(&self, event_id: &EventId, pdu: &CanonicalJsonObject) -> Result<()> {
self.db.add_pdu_outlier(event_id, pdu)
}
}