fixup! Get required keys in batch when joining a room

This commit is contained in:
Kurt Roeckx 2021-08-29 14:39:38 +02:00 committed by Jonas Zohren
parent a8d181e00e
commit fc3ff86ad9

View file

@ -3437,7 +3437,9 @@ pub async fn fetch_join_signing_keys(
// TODO: Check signature // TODO: Check signature
servers.remove(&k.server_name); servers.remove(&k.server_name);
let result = db.globals.add_signing_key(&k.server_name, k.clone())? let result = db
.globals
.add_signing_key(&k.server_name, k.clone())?
.into_iter() .into_iter()
.map(|(k, v)| (k.to_string(), v.key)) .map(|(k, v)| (k.to_string(), v.key))
.collect::<BTreeMap<_, _>>(); .collect::<BTreeMap<_, _>>();
@ -3459,7 +3461,8 @@ pub async fn fetch_join_signing_keys(
if let Ok(get_keys_response) = result { if let Ok(get_keys_response) = result {
// TODO: We should probably not trust the server_name in the response. // TODO: We should probably not trust the server_name in the response.
let server = &get_keys_response.server_key.server_name; let server = &get_keys_response.server_key.server_name;
let result = db.globals let result = db
.globals
.add_signing_key(server, get_keys_response.server_key.clone())? .add_signing_key(server, get_keys_response.server_key.clone())?
.into_iter() .into_iter()
.map(|(k, v)| (k.to_string(), v.key)) .map(|(k, v)| (k.to_string(), v.key))