async fn build_sync_events(
services: &Services,
sender_user: &UserId,
sender_device: Option<&DeviceId>,
since: u64,
next_batch: u64,
full_state: bool,
state_after: StateAfter,
filter: &FilterDefinition,
) -> Result<Response>