mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
separate account_data service methods for room vs global events
Previously we were mashing everything together as RoomAccountDataEvent, even the global events. This technically worked, because of the hidden custom fields on the ruma event types, but it's confusing and easy to mess up. Separate methods with appropriate types are preferable.
This commit is contained in:
parent
6897f0ba34
commit
66210bc32d
16 changed files with 349 additions and 361 deletions
|
|
@ -644,17 +644,8 @@ pub(crate) async fn sync_events_v4_route(
|
|||
{
|
||||
services()
|
||||
.account_data
|
||||
.changes_since(None, &sender_user, globalsince)?
|
||||
.into_iter()
|
||||
.filter_map(|(_, v)| {
|
||||
serde_json::from_str(v.json().get())
|
||||
.map_err(|_| {
|
||||
Error::bad_database(
|
||||
"Invalid account event in database.",
|
||||
)
|
||||
})
|
||||
.ok()
|
||||
})
|
||||
.global_changes_since(&sender_user, globalsince)?
|
||||
.into_values()
|
||||
.collect()
|
||||
} else {
|
||||
Vec::new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue