log rejected sendjoin, remove unnecessary clone
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
0ed891b3a1
commit
8454773275
4 changed files with 24 additions and 14 deletions
|
@ -631,7 +631,7 @@ async fn join_room_by_id_helper(
|
|||
));
|
||||
}
|
||||
|
||||
if let Ok(signature) = signed_value["signatures"]
|
||||
match signed_value["signatures"]
|
||||
.as_object()
|
||||
.ok_or(Error::BadRequest(
|
||||
ErrorKind::InvalidParam,
|
||||
|
@ -642,18 +642,20 @@ async fn join_room_by_id_helper(
|
|||
ErrorKind::InvalidParam,
|
||||
"Server did not send its signature",
|
||||
))
|
||||
})
|
||||
{
|
||||
join_event
|
||||
.get_mut("signatures")
|
||||
.expect("we created a valid pdu")
|
||||
.as_object_mut()
|
||||
.expect("we created a valid pdu")
|
||||
.insert(remote_server.to_string(), signature.clone());
|
||||
} else {
|
||||
warn!(
|
||||
"Server {remote_server} sent invalid signature in sendjoin signatures for event {signed_value:?}",
|
||||
);
|
||||
}) {
|
||||
Ok(signature) => {
|
||||
join_event
|
||||
.get_mut("signatures")
|
||||
.expect("we created a valid pdu")
|
||||
.as_object_mut()
|
||||
.expect("we created a valid pdu")
|
||||
.insert(remote_server.to_string(), signature.clone());
|
||||
}
|
||||
Err(e) => {
|
||||
warn!(
|
||||
"Server {remote_server} sent invalid signature in sendjoin signatures for event {signed_value:?}: {e:?}",
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1921,7 +1921,7 @@ pub async fn get_devices_route(
|
|||
let device_id_string = metadata.device_id.as_str().to_owned();
|
||||
let device_display_name = match services().globals.allow_device_name_federation() {
|
||||
true => metadata.display_name,
|
||||
false => Some(device_id_string.to_string()),
|
||||
false => Some(device_id_string),
|
||||
};
|
||||
Some(UserDevice {
|
||||
keys: services()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue