mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-16 23:31:24 +01:00
SSS: implement typing indications
This commit is contained in:
parent
3f315ee683
commit
f903421c3f
1 changed files with 23 additions and 3 deletions
|
|
@ -573,6 +573,28 @@ pub(crate) async fn sync_events_v5_route(
|
|||
None
|
||||
};
|
||||
|
||||
let typing = if body.extensions.typing.enabled == Some(true) {
|
||||
let mut typing = BTreeMap::new();
|
||||
for room_id in todo_rooms.keys() {
|
||||
if services().rooms.edus.typing.last_typing_update(room_id).await?
|
||||
> globalsince
|
||||
{
|
||||
let event =
|
||||
services().rooms.edus.typing.typings_all(room_id).await?;
|
||||
|
||||
let Ok(event) = Raw::new(&event) else {
|
||||
continue;
|
||||
};
|
||||
typing.insert(room_id.clone(), event);
|
||||
}
|
||||
}
|
||||
Some(sync_events::v5::response::Typing {
|
||||
rooms: typing,
|
||||
})
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let mut rooms = BTreeMap::new();
|
||||
for (room_id, todo_room) in todo_rooms {
|
||||
if let Some(room) =
|
||||
|
|
@ -587,9 +609,7 @@ pub(crate) async fn sync_events_v5_route(
|
|||
e2ee: e2ee.unwrap_or_default(),
|
||||
account_data: account_data.unwrap_or_default(),
|
||||
receipts: receipts.unwrap_or_default(),
|
||||
typing: sync_events::v5::response::Typing {
|
||||
rooms: BTreeMap::new(),
|
||||
},
|
||||
typing: typing.unwrap_or_default(),
|
||||
};
|
||||
|
||||
let extensions_empty = extensions
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue