aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-09-06 07:00:22 +0800
committerDan Winship <danw@src.gnome.org>2000-09-06 07:00:22 +0800
commitaaeea6be5472f42e60b022c382bbf1f2c91d9506 (patch)
tree9c8883760072c3c1c15bf5fe043b504145e1db8e
parenteafd7dbe013871f1090e0179e99ca309626c2076 (diff)
downloadgsoc2013-evolution-aaeea6be5472f42e60b022c382bbf1f2c91d9506.tar
gsoc2013-evolution-aaeea6be5472f42e60b022c382bbf1f2c91d9506.tar.gz
gsoc2013-evolution-aaeea6be5472f42e60b022c382bbf1f2c91d9506.tar.bz2
gsoc2013-evolution-aaeea6be5472f42e60b022c382bbf1f2c91d9506.tar.lz
gsoc2013-evolution-aaeea6be5472f42e60b022c382bbf1f2c91d9506.tar.xz
gsoc2013-evolution-aaeea6be5472f42e60b022c382bbf1f2c91d9506.tar.zst
gsoc2013-evolution-aaeea6be5472f42e60b022c382bbf1f2c91d9506.zip
If a MIME part has no Content-Disposition, but does have a "name" on the
* camel-mime-part.c (camel_mime_part_get_filename): If a MIME part has no Content-Disposition, but does have a "name" on the Content-Type, return that as the filename. (process_header): strstrip the Content-Description svn path=/trunk/; revision=5213
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-mime-part.c12
2 files changed, 15 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 97218b1433..e5ee3794f9 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,10 @@
+2000-09-05 Dan Winship <danw@helixcode.com>
+
+ * camel-mime-part.c (camel_mime_part_get_filename): If a MIME part
+ has no Content-Disposition, but does have a "name" on the
+ Content-Type, return that as the filename.
+ (process_header): strstrip the Content-Description
+
2000-09-05 Chris Toshok <toshok@helixcode.com>
* providers/nntp/camel-nntp-utils.c (get_OVER_headers): care about
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index f372240347..d37b4c2fae 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -199,7 +199,7 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_
case HEADER_DESCRIPTION: /* raw header->utf8 conversion */
text = header_decode_string(header_value);
g_free(mime_part->description);
- mime_part->description = text;
+ mime_part->description = g_strstrip (text);
break;
case HEADER_DISPOSITION:
set_disposition (mime_part, header_value);
@@ -351,9 +351,13 @@ camel_mime_part_set_filename (CamelMimePart *mime_part, const gchar *filename)
const gchar *
camel_mime_part_get_filename (CamelMimePart *mime_part)
{
- if (mime_part->disposition)
- return header_param(mime_part->disposition->params, "filename");
- return NULL;
+ if (mime_part->disposition) {
+ const gchar *name = header_param (mime_part->disposition->params, "filename");
+ if (name)
+ return name;
+ }
+
+ return gmime_content_field_get_parameter (mime_part->content_type, "name");
}