diff --git a/CHANGELOG.md b/CHANGELOG.md index 106868563..c6170c32c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ - refactorings #3023 - remove direct dependency on `byteorder` crate #3031 +### Fixes +- fix splitting off text from webxdc messages #3032 + ## 1.72.0 diff --git a/src/mimeparser.rs b/src/mimeparser.rs index 4e98b8fab..e39191890 100644 --- a/src/mimeparser.rs +++ b/src/mimeparser.rs @@ -403,16 +403,18 @@ impl MimeMessage { #[allow(clippy::indexing_slicing)] fn squash_attachment_parts(&mut self) { if let [textpart, filepart] = &self.parts[..] { - let need_drop = { - textpart.typ == Viewtype::Text - && (filepart.typ == Viewtype::Image - || filepart.typ == Viewtype::Gif - || filepart.typ == Viewtype::Sticker - || filepart.typ == Viewtype::Audio - || filepart.typ == Viewtype::Voice - || filepart.typ == Viewtype::Video - || filepart.typ == Viewtype::File) - }; + let need_drop = textpart.typ == Viewtype::Text + && match filepart.typ { + Viewtype::Image + | Viewtype::Gif + | Viewtype::Sticker + | Viewtype::Audio + | Viewtype::Voice + | Viewtype::Video + | Viewtype::File + | Viewtype::Webxdc => true, + Viewtype::Unknown | Viewtype::Text | Viewtype::VideochatInvitation => false, + }; if need_drop { let mut filepart = self.parts.swap_remove(1);