mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 23:31:24 +01:00
SSS: implement room account data
This commit is contained in:
parent
d497a19c2d
commit
72c898dd41
1 changed files with 19 additions and 1 deletions
|
|
@ -484,9 +484,27 @@ pub(crate) async fn sync_events_v5_route(
|
|||
})
|
||||
.collect();
|
||||
|
||||
let mut rooms_account_data = BTreeMap::new();
|
||||
for (room_id, todo_room) in &todo_rooms {
|
||||
let account_data: Vec<_> = services()
|
||||
.account_data
|
||||
.room_changes_since(&sender_user, room_id, todo_room.roomsince)?
|
||||
.into_iter()
|
||||
.map(|(event_type, content)| {
|
||||
account_data::raw_room_event_from_parts(
|
||||
&event_type,
|
||||
&content,
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
if !account_data.is_empty() {
|
||||
rooms_account_data.insert(room_id.clone(), account_data);
|
||||
}
|
||||
}
|
||||
|
||||
Some(sync_events::v5::response::AccountData {
|
||||
global,
|
||||
rooms: BTreeMap::new(),
|
||||
rooms: rooms_account_data,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue