basic w30 sending and receiving

This commit is contained in:
B. Petersen
2021-11-22 18:20:34 +01:00
committed by bjoern
parent 41f9314e2a
commit de20e4c9dd
16 changed files with 810 additions and 7 deletions

View File

@@ -258,6 +258,15 @@ pub(crate) async fn dc_receive_imf_inner(
}
}
if let Some(ref status_update) = mime_parser.w30_status_update {
if let Err(err) = context
.receive_status_update(insert_msg_id, status_update)
.await
{
warn!(context, "receive_imf cannot update status: {}", err);
}
}
if let Some(avatar_action) = &mime_parser.user_avatar {
if from_id != 0
&& context
@@ -860,6 +869,15 @@ async fn add_parts(
info!(context, "Existing non-decipherable message. (TRASH)");
}
if mime_parser.w30_status_update.is_some() && mime_parser.parts.len() == 1 {
if let Some(part) = mime_parser.parts.first() {
if part.typ == Viewtype::Text && part.msg.is_empty() {
chat_id = Some(DC_CHAT_ID_TRASH);
info!(context, "Message is a status update only (TRASH)");
}
}
}
if is_mdn {
chat_id = Some(DC_CHAT_ID_TRASH);
}