Update src/chat.rs

Co-authored-by: Hocuri <hocuri@gmx.de>
This commit is contained in:
bjoern
2020-06-07 15:44:23 +02:00
committed by B. Petersen
parent 945943a849
commit 17283c86a3

View File

@@ -1333,8 +1333,10 @@ async fn prepare_msg_blob(context: &Context, msg: &mut Message) -> Result<(), Er
format_err!("Attachment missing for message of type #{}", msg.viewtype)
})?;
if msg.viewtype == Viewtype::Image && blob.recode_to_image_size(context).await.is_err() {
warn!(context, "Cannot recode image, using original data");
if msg.viewtype == Viewtype::Image {
if let Err(e) = blob.recode_to_image_size(context).await {
warn!(context, "Cannot recode image, using original data: {:?}", e);
}
}
msg.param.set(Param::File, blob.as_name());