refactor account_data.changes_since to stream
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -136,10 +136,9 @@ pub(crate) async fn sync_events_v4_route(
|
||||
account_data.global = services
|
||||
.account_data
|
||||
.changes_since(None, sender_user, globalsince)
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Global))
|
||||
.collect();
|
||||
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Global))
|
||||
.collect()
|
||||
.await;
|
||||
|
||||
if let Some(rooms) = body.extensions.account_data.rooms {
|
||||
for room in rooms {
|
||||
@@ -148,10 +147,9 @@ pub(crate) async fn sync_events_v4_route(
|
||||
services
|
||||
.account_data
|
||||
.changes_since(Some(&room), sender_user, globalsince)
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
|
||||
.collect(),
|
||||
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
|
||||
.collect()
|
||||
.await,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -487,10 +485,9 @@ pub(crate) async fn sync_events_v4_route(
|
||||
services
|
||||
.account_data
|
||||
.changes_since(Some(room_id), sender_user, *roomsince)
|
||||
.await?
|
||||
.into_iter()
|
||||
.filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
|
||||
.collect(),
|
||||
.ready_filter_map(|e| extract_variant!(e, AnyRawAccountDataEvent::Room))
|
||||
.collect()
|
||||
.await,
|
||||
);
|
||||
|
||||
let vector: Vec<_> = services
|
||||
|
||||
Reference in New Issue
Block a user