mirror of
https://github.com/chatmail/core.git
synced 2026-05-06 16:36:59 +03:00
Fix(jsonrpc): Do not error on missign webxdc info (#6866)
When an invalid webxdc is set as draft, json-rpc's `get_draft` fails, because `get_webxdc_info` which it calls, fails because the zip reader can not read a non-zip file. With this change, any error occurring in `get_webxdc_info` is ignored and the None-variant is returned instead. I also added a test, that setting invalid xdcs is draft is fine core-wise and checked that the input field stays responsive when a fake.xdc produced like in #6826 is added to draft close #6826
This commit is contained in:
@@ -8,6 +8,7 @@ use deltachat::chat::ChatVisibility;
|
||||
use deltachat::contact::Contact;
|
||||
use deltachat::context::Context;
|
||||
use deltachat::download;
|
||||
use deltachat::log::LogExt as _;
|
||||
use deltachat::message::Message;
|
||||
use deltachat::message::MsgId;
|
||||
use deltachat::message::Viewtype;
|
||||
@@ -143,7 +144,10 @@ impl MessageObject {
|
||||
let override_sender_name = message.get_override_sender_name();
|
||||
|
||||
let webxdc_info = if message.get_viewtype() == Viewtype::Webxdc {
|
||||
Some(WebxdcMessageInfo::get_for_message(context, msg_id).await?)
|
||||
WebxdcMessageInfo::get_for_message(context, msg_id)
|
||||
.await
|
||||
.log_err(context)
|
||||
.ok()
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user