mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 15:51:23 +01:00
use event content in account_data service api instead of full events
This eliminates the possibility of passing an event that has a mismatching type, reducing the space of possible invalid states.
This commit is contained in:
parent
66210bc32d
commit
b82458a460
15 changed files with 277 additions and 240 deletions
|
|
@ -25,7 +25,8 @@ use tracing::{debug, error};
|
|||
|
||||
use super::{load_timeline, share_encrypted_room};
|
||||
use crate::{
|
||||
service::rooms::timeline::PduCount, services, Ar, Error, Ra, Result,
|
||||
service::{account_data, rooms::timeline::PduCount},
|
||||
services, Ar, Error, Ra, Result,
|
||||
};
|
||||
|
||||
#[allow(clippy::too_many_lines)]
|
||||
|
|
@ -645,7 +646,13 @@ pub(crate) async fn sync_events_v4_route(
|
|||
services()
|
||||
.account_data
|
||||
.global_changes_since(&sender_user, globalsince)?
|
||||
.into_values()
|
||||
.into_iter()
|
||||
.map(|(event_type, content)| {
|
||||
account_data::raw_global_event_from_parts(
|
||||
&event_type,
|
||||
&content,
|
||||
)
|
||||
})
|
||||
.collect()
|
||||
} else {
|
||||
Vec::new()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue