[geary/wip/713830-disposition] Show non-image or text MIME part w/o Content-Disposition as attachment
- From: Jim Nelson <jnelson src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/713830-disposition] Show non-image or text MIME part w/o Content-Disposition as attachment
- Date: Wed, 30 Jul 2014 22:50:42 +0000 (UTC)
commit 1edfdde01cc91798b029e693a0a189e78b16e06a
Author: Jim Nelson <jim yorba org>
Date: Wed Jul 30 15:26:16 2014 -0700
Show non-image or text MIME part w/o Content-Disposition as attachment
src/engine/rfc822/rfc822-message.vala | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/rfc822/rfc822-message.vala b/src/engine/rfc822/rfc822-message.vala
index f38b694..12fea54 100644
--- a/src/engine/rfc822/rfc822-message.vala
+++ b/src/engine/rfc822/rfc822-message.vala
@@ -753,14 +753,17 @@ public class Geary.RFC822.Message : BaseObject {
return;
}
+ // If requested disposition is not UNSPECIFIED, check if this part matches the requested deposition
Mime.DispositionType part_disposition = Mime.DispositionType.deserialize(part.get_disposition(),
null);
- if (part_disposition == Mime.DispositionType.UNSPECIFIED)
+ if (requested_disposition != Mime.DispositionType.UNSPECIFIED && requested_disposition !=
part_disposition)
return;
+ // skip text/plain and text/html parts that are INLINE or UNSPECIFIED, as they will be used
+ // as part of the body
if (part.get_content_type() != null) {
Mime.ContentType content_type = new Mime.ContentType.from_gmime(part.get_content_type());
- if (part_disposition == Mime.DispositionType.INLINE
+ if ((part_disposition == Mime.DispositionType.INLINE || part_disposition ==
Mime.DispositionType.UNSPECIFIED)
&& content_type.has_media_type("text")
&& (content_type.has_media_subtype("html") || content_type.has_media_subtype("plain"))) {
// these are part of the body
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]