conduwuit/src/service/rooms/pdu_metadata/mod.rs

34 lines
921 B
Rust
Raw Normal View History

mod data;
use std::sync::Arc;
pub use data::Data;
use ruma::{RoomId, EventId};
2022-09-07 13:25:51 +02:00
use crate::Result;
2022-10-05 12:45:54 +02:00
pub struct Service {
2022-10-05 18:36:12 +02:00
db: Arc<dyn Data>,
}
2022-10-05 12:45:54 +02:00
impl Service {
#[tracing::instrument(skip(self, room_id, event_ids))]
pub fn mark_as_referenced(&self, room_id: &RoomId, event_ids: &[Arc<EventId>]) -> Result<()> {
self.db.mark_as_referenced(room_id, event_ids)
}
#[tracing::instrument(skip(self))]
2021-07-20 12:41:35 +02:00
pub fn is_event_referenced(&self, room_id: &RoomId, event_id: &EventId) -> Result<bool> {
self.db.is_event_referenced(room_id, event_id)
}
2021-08-28 11:39:33 +02:00
#[tracing::instrument(skip(self))]
pub fn mark_event_soft_failed(&self, event_id: &EventId) -> Result<()> {
self.db.mark_event_soft_failed(event_id)
2021-08-28 11:39:33 +02:00
}
#[tracing::instrument(skip(self))]
pub fn is_event_soft_failed(&self, event_id: &EventId) -> Result<bool> {
self.db.is_event_soft_failed(event_id)
}
}