aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorLarry Ewing <lewing@ximian.com>2001-10-02 02:23:05 +0800
committerLarry Ewing <lewing@src.gnome.org>2001-10-02 02:23:05 +0800
commitda449e4daccb7d800398d5b350d50bea87df2c4c (patch)
tree6b86506239649ca0fd87e4e735954205c22d5493 /mail
parent0b2cc6633c190b8433ea0c5ef818697ffdf51744 (diff)
downloadgsoc2013-evolution-da449e4daccb7d800398d5b350d50bea87df2c4c.tar
gsoc2013-evolution-da449e4daccb7d800398d5b350d50bea87df2c4c.tar.gz
gsoc2013-evolution-da449e4daccb7d800398d5b350d50bea87df2c4c.tar.bz2
gsoc2013-evolution-da449e4daccb7d800398d5b350d50bea87df2c4c.tar.lz
gsoc2013-evolution-da449e4daccb7d800398d5b350d50bea87df2c4c.tar.xz
gsoc2013-evolution-da449e4daccb7d800398d5b350d50bea87df2c4c.tar.zst
gsoc2013-evolution-da449e4daccb7d800398d5b350d50bea87df2c4c.zip
if gnome-vfs returns application/octet-stream with the magic check, use
2001-10-01 Larry Ewing <lewing@ximian.com> * mail-identify.c (mail_identify_mime_part): if gnome-vfs returns application/octet-stream with the magic check, use the filename check instead since it at least has a chance of being useful. svn path=/trunk/; revision=13265
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-identify.c22
2 files changed, 21 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 974b112950..96036df76f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2001-10-01 Larry Ewing <lewing@ximian.com>
+
+ * mail-identify.c (mail_identify_mime_part): if gnome-vfs returns
+ application/octet-stream with the magic check, use the filename
+ check instead since it at least has a chance of being useful.
+
2001-09-28 Dan Winship <danw@ximian.com>
* folder-browser-ui.c (fbui_sensitize_timeout): wrap a
diff --git a/mail/mail-identify.c b/mail/mail-identify.c
index e3a0eefb14..5d0b5f1a69 100644
--- a/mail/mail-identify.c
+++ b/mail/mail-identify.c
@@ -66,13 +66,21 @@ mail_identify_mime_part (CamelMimePart *part, MailDisplay *md)
if (!camel_data_wrapper_is_offline (data))
magic_type = identify_by_magic (data, md);
- /* If GNOME-VFS doesn't recognize the data by magic, but it
- * contains English words, it will call it text/plain. If the
- * filename-based check came up with something different, use
- * that instead.
- */
- if (magic_type && name_type && !strcmp (magic_type, "text/plain"))
- return g_strdup (name_type);
+ if (magic_type && name_type) {
+ /* If GNOME-VFS doesn't recognize the data by magic, but it
+ * contains English words, it will call it text/plain. If the
+ * filename-based check came up with something different, use
+ * that instead.
+ */
+ if (!strcmp (magic_type, "text/plain"))
+ return g_strdup (name_type);
+
+ /* If if returns "application/octet-stream" try to
+ * do better with the filename check.
+ */
+ if (!strcmp (magic_type, "application/octet-stream"))
+ return g_strdup (name_type);
+ }
/* If the MIME part data was online, and the magic check
* returned something, use that, since it's more reliable.