syncv3: support per room account data

This commit is contained in:
morguldir 2024-08-30 10:31:08 +02:00
parent 36b8de1339
commit 77c0c13a83
No known key found for this signature in database
GPG key ID: 5A6025D4F6E7A8A3
5 changed files with 91 additions and 67 deletions

View file

@ -1,12 +1,11 @@
mod data;
use std::{collections::HashMap, sync::Arc};
use std::sync::Arc;
use conduit::Result;
use data::Data;
use ruma::{
events::{AnyEphemeralRoomEvent, RoomAccountDataEventType},
serde::Raw,
events::{AnyRawAccountDataEvent, RoomAccountDataEventType},
RoomId, UserId,
};
@ -47,7 +46,7 @@ impl Service {
#[tracing::instrument(skip_all, name = "since", level = "debug")]
pub fn changes_since(
&self, room_id: Option<&RoomId>, user_id: &UserId, since: u64,
) -> Result<HashMap<RoomAccountDataEventType, Raw<AnyEphemeralRoomEvent>>> {
) -> Result<Vec<AnyRawAccountDataEvent>> {
self.db.changes_since(room_id, user_id, since)
}
}