fix: e2ee verification
This commit is contained in:
parent
ac0027756e
commit
8c44312485
5 changed files with 12 additions and 8 deletions
|
@ -64,7 +64,7 @@ impl Tree for SledEngineTree {
|
|||
backwards: bool,
|
||||
) -> Box<dyn Iterator<Item = (Vec<u8>, Vec<u8>)> + Send> {
|
||||
let iter = if backwards {
|
||||
self.0.range(..from)
|
||||
self.0.range(..=from)
|
||||
} else {
|
||||
self.0.range(from..)
|
||||
};
|
||||
|
|
|
@ -1495,7 +1495,7 @@ impl Rooms {
|
|||
prefix.push(0xff);
|
||||
|
||||
let mut current = prefix.clone();
|
||||
current.extend_from_slice(&until.to_be_bytes());
|
||||
current.extend_from_slice(&(until.saturating_sub(1)).to_be_bytes()); // -1 because we don't want event at `until`
|
||||
|
||||
let current: &[u8] = ¤t;
|
||||
|
||||
|
|
|
@ -726,10 +726,9 @@ impl Users {
|
|||
json.insert("sender".to_owned(), sender.to_string().into());
|
||||
json.insert("content".to_owned(), content);
|
||||
|
||||
self.todeviceid_events.insert(
|
||||
&key,
|
||||
&serde_json::to_vec(&json).expect("Map::to_vec always works"),
|
||||
)?;
|
||||
let value = serde_json::to_vec(&json).expect("Map::to_vec always works");
|
||||
|
||||
self.todeviceid_events.insert(&key, &value)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
@ -774,7 +773,7 @@ impl Users {
|
|||
|
||||
for (key, _) in self
|
||||
.todeviceid_events
|
||||
.iter_from(&last, true)
|
||||
.iter_from(&last, true) // this includes last
|
||||
.take_while(move |(k, _)| k.starts_with(&prefix))
|
||||
.map(|(key, _)| {
|
||||
Ok::<_, Error>((
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue