diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-08-05 03:00:40 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-08-05 03:00:40 +0800 |
commit | 27556a45c288a2d2bdbfd05e7ee95f4ae61398fe (patch) | |
tree | 8869ba974408bf46571bbad99e584776eb4ae85e /mail/mail-format.c | |
parent | ed0295fd125834f672109cf6f968b21b224069ad (diff) | |
download | gsoc2013-evolution-27556a45c288a2d2bdbfd05e7ee95f4ae61398fe.tar gsoc2013-evolution-27556a45c288a2d2bdbfd05e7ee95f4ae61398fe.tar.gz gsoc2013-evolution-27556a45c288a2d2bdbfd05e7ee95f4ae61398fe.tar.bz2 gsoc2013-evolution-27556a45c288a2d2bdbfd05e7ee95f4ae61398fe.tar.lz gsoc2013-evolution-27556a45c288a2d2bdbfd05e7ee95f4ae61398fe.tar.xz gsoc2013-evolution-27556a45c288a2d2bdbfd05e7ee95f4ae61398fe.tar.zst gsoc2013-evolution-27556a45c288a2d2bdbfd05e7ee95f4ae61398fe.zip |
Add yet another special-case hack for application/pgp.
2001-08-04 Jeffrey Stedfast <fejj@ximian.com>
* mail-format.c (mail_part_is_inline): Add yet another
special-case hack for application/pgp.
svn path=/trunk/; revision=11652
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r-- | mail/mail-format.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c index 7522b1d674..983565cdda 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -96,9 +96,11 @@ static gboolean handle_message_external_body (CamelMimePart *part, const char *mime_type, MailDisplay *md); +#ifdef APPLICATION_PGP_IS_NO_LONGER_SUPPORTED static gboolean handle_application_pgp (CamelMimePart *part, const char *mime_type, MailDisplay *md); +#ifdef /* APPLICATION_PGP_IS_NO_LONGER_SUPPORTED */ static gboolean handle_via_bonobo (CamelMimePart *part, const char *mime_type, @@ -346,12 +348,14 @@ setup_mime_tables (void) g_hash_table_insert (mime_function_table, "multipart/signed", handle_multipart_signed); +#ifdef APPLICATION_PGP_IS_NO_LONGER_SUPPORTED /* Some broken mailers, such as The Bat! send pgp * signed/encrypted messages with a content-type of * application/pgp which basically means it's a text/plain but * either signed or encrypted. */ g_hash_table_insert (mime_function_table, "application/pgp", handle_application_pgp); +#endif /* APPLICATION_PGP_IS_NO_LONGER_SUPPORTED */ /* RFC 2046 says unrecognized text subtypes can be treated * as text/plain (as long as you recognize the character set), @@ -483,11 +487,11 @@ is_anonymous (CamelMimePart *part, const char *mime_type) if (!g_strncasecmp (mime_type, "multipart/", 10) || !g_strncasecmp (mime_type, "message/", 8)) return TRUE; - + if (!g_strncasecmp (mime_type, "text/", 5) && !camel_mime_part_get_filename (part)) return TRUE; - + return FALSE; } @@ -504,25 +508,35 @@ mail_part_is_inline (CamelMimePart *part) CamelContentType *content_type; char *type; gboolean anon; - + /* If it has an explicit disposition, return that. */ disposition = camel_mime_part_get_disposition (part); if (disposition) return g_strcasecmp (disposition, "inline") == 0; - + /* Certain types should default to inline. FIXME: this should * be customizable. */ content_type = camel_mime_part_get_content_type (part); if (!header_content_type_is (content_type, "message", "*")) return TRUE; - + +#ifdef APPLICATION_PGP_IS_NO_LONGER_SUPPORTED + /* The Bat! and possibly a few other broken mailers send application/pgp + * parts instead of following rfc2015 because they SUCK!!! Since this part + * is really a text/plain part, we should show it inline. + */ + if (!header_content_type_is (content_type, "application", "pgp")) + return TRUE; +#endif /* APPLICATION_PGP_IS_NO_LONGER_SUPPORTED */ + /* Otherwise, display it inline if it's "anonymous", and * as an attachment otherwise. */ type = header_content_type_simple (content_type); anon = is_anonymous (part, type); g_free (type); + return anon; } @@ -1106,6 +1120,7 @@ handle_text_plain (CamelMimePart *part, const char *mime_type, return TRUE; } +#ifdef APPLICATION_PGP_IS_NO_LONGER_SUPPORTED /* This is a special-case hack from broken mailers such as The Bat! */ static gboolean handle_application_pgp (CamelMimePart *part, const char *mime_type, @@ -1160,6 +1175,7 @@ handle_application_pgp (CamelMimePart *part, const char *mime_type, return handle_text_plain (part, "text/plain", md); } +#endif /* APPLICATION_PGP_IS_NO_LONGER_SUPPORTED */ static gboolean handle_text_plain_flowed (char *buf, MailDisplay *md) |