Add relations endpoints, edits and threads work now

This commit is contained in:
Timo Kösters 2023-06-26 12:38:51 +02:00
parent db6def8800
commit 72eb1972c1
No known key found for this signature in database
GPG key ID: 0B25E636FBA7E4CB
8 changed files with 385 additions and 29 deletions

View file

@ -1,10 +1,17 @@
use std::sync::Arc;
use crate::Result;
use ruma::{EventId, RoomId};
use crate::{service::rooms::timeline::PduCount, PduEvent, Result};
use ruma::{EventId, RoomId, UserId};
pub trait Data: Send + Sync {
fn add_relation(&self, from: u64, to: u64) -> Result<()>;
fn relations_until<'a>(
&'a self,
user_id: &'a UserId,
room_id: u64,
target: u64,
until: PduCount,
) -> Result<Box<dyn Iterator<Item = Result<(PduCount, PduEvent)>> + 'a>>;
fn mark_as_referenced(&self, room_id: &RoomId, event_ids: &[Arc<EventId>]) -> Result<()>;
fn is_event_referenced(&self, room_id: &RoomId, event_id: &EventId) -> Result<bool>;
fn mark_event_soft_failed(&self, event_id: &EventId) -> Result<()>;