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