Address some review issues fmt, errors, comments

This commit is contained in:
Devin Ragotzy 2020-11-15 16:48:43 -05:00 committed by Timo Kösters
parent 86bb93f8cf
commit bb24f6ad90
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
7 changed files with 50 additions and 39 deletions

View file

@ -256,7 +256,7 @@ pub async fn get_backup_key_session_route(
let key_data = db
.key_backups
.get_session(&sender_user, &body.version, &body.room_id, &body.session_id)?
.ok_or_else(|| Error::BadDatabase("Backup key not found for this user's session"))?;
.ok_or_else(|| Error::bad_database("Backup key not found for this user's session."))?;
Ok(get_backup_key_session::Response { key_data }.into())
}

View file

@ -39,7 +39,7 @@ pub async fn create_content_route(
db.media.create(
mxc.clone(),
&body.filename.as_deref(),
&body.content_type.as_deref(), // TODO this is now optional handle
&body.content_type.as_deref(),
&body.file,
)?;

View file

@ -519,7 +519,6 @@ async fn join_room_by_id_helper(
canon_json_stub.remove("event_id");
// In order to create a compatible ref hash (EventID) the `hashes` field needs to be present
// who the hell knew...
ruma::signatures::hash_and_sign_event(
db.globals.server_name().as_str(),
db.globals.keypair(),
@ -602,7 +601,6 @@ async fn join_room_by_id_helper(
)))) // Add join event we just created
.map(|r| {
let (event_id, value) = r?;
// TODO remove .clone when I remove debug logging
state_res::StateEvent::from_id_value(event_id.clone(), value.clone())
.map(|ev| (event_id, Arc::new(ev)))
.map_err(|e| {