improvement: more efficient /sync with gaps

This commit is contained in:
Timo Kösters 2020-09-17 14:44:47 +02:00
parent 506c2a3146
commit ea3aaa6b5c
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
10 changed files with 251 additions and 299 deletions

View file

@ -1,4 +1,4 @@
use crate::{Error, Result};
use crate::Error;
use js_int::UInt;
use ruma::{
events::pdu::PduStub,
@ -35,7 +35,7 @@ pub struct PduEvent {
}
impl PduEvent {
pub fn redact(&mut self, reason: &PduEvent) -> Result<()> {
pub fn redact(&mut self, reason: &PduEvent) -> crate::Result<()> {
self.unsigned.clear();
let allowed: &[&str] = match self.kind {
@ -244,7 +244,7 @@ impl From<&state_res::StateEvent> for PduEvent {
.expect("time is valid"),
kind: pdu.kind(),
content: pdu.content().clone(),
state_key: pdu.state_key(),
state_key: Some(pdu.state_key()),
prev_events: pdu.prev_event_ids(),
depth: pdu.depth().clone(),
auth_events: pdu.auth_events(),