let render_webxdc_status_update_object() return an Option; add a test for that

This commit is contained in:
B. Petersen
2022-01-10 13:26:33 +01:00
committed by bjoern
parent 42f9ef00b9
commit 327328412a
2 changed files with 36 additions and 6 deletions

View File

@@ -1163,10 +1163,10 @@ impl<'a> MimeFactory<'a> {
let json = self.msg.param.get(Param::Arg).unwrap_or_default();
parts.push(context.build_status_update_part(json).await);
} else if self.msg.viewtype == Viewtype::Webxdc {
let json = context
if let Some(json) = context
.render_webxdc_status_update_object(self.msg.id, None)
.await?;
if json != r#"{{"updates":[]}}"# {
.await?
{
parts.push(context.build_status_update_part(&json).await);
}
}