Fix review issues, Remove EventHash's in prev/auth_events in StateEvent

The latest state-res crate uses ruma's PduRoomV3 PDU's which don't have
tuples of (EventId, EventHashs) like previous versions did (this was
left from rebasing onto master). The Media DB
now takes an optional content_type like the updated ruma structs.
This commit is contained in:
Devin Ragotzy 2020-11-11 14:30:12 -05:00 committed by Timo Kösters
parent acd144e934
commit 234b226468
No known key found for this signature in database
GPG key ID: 24DA7517711A2BA4
5 changed files with 23 additions and 26 deletions

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().unwrap_or("img"), // TODO this is now optional handle
&body.content_type.as_deref(), // TODO this is now optional handle
&body.file,
)?;
@ -85,10 +85,7 @@ pub async fn get_content_route(
db.media.create(
mxc,
&get_content_response.content_disposition.as_deref(),
get_content_response // TODO this is now optional handle
.content_type
.as_deref()
.unwrap_or("img"),
&get_content_response.content_type.as_deref(),
&get_content_response.file,
)?;
@ -142,10 +139,7 @@ pub async fn get_content_thumbnail_route(
db.media.upload_thumbnail(
mxc,
&None,
get_thumbnail_response
.content_type
.as_deref()
.unwrap_or("img"), // TODO now optional, deal with it somehow
&get_thumbnail_response.content_type,
body.width.try_into().expect("all UInts are valid u32s"),
body.height.try_into().expect("all UInts are valid u32s"),
&get_thumbnail_response.file,