mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-23 11:28:13 +01:00
cli: content disposition values are not case-sensitive
Per RFC 2183, the values for Content-Disposition values are not case-sensitive. While at it, use the gmime function for getting at the disposition string instead of referencing the field directly. This fixes attachment display and quoting in notmuch show and reply, respectively.
This commit is contained in:
parent
506b81679a
commit
1abc338331
2 changed files with 4 additions and 2 deletions
|
@ -80,7 +80,8 @@ format_part_reply (mime_node_t *node)
|
||||||
show_text_part_content (node->part, stream_stdout, NOTMUCH_SHOW_TEXT_PART_REPLY);
|
show_text_part_content (node->part, stream_stdout, NOTMUCH_SHOW_TEXT_PART_REPLY);
|
||||||
g_object_unref(stream_stdout);
|
g_object_unref(stream_stdout);
|
||||||
} else if (disposition &&
|
} else if (disposition &&
|
||||||
strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0) {
|
strcasecmp (g_mime_content_disposition_get_disposition (disposition),
|
||||||
|
GMIME_DISPOSITION_ATTACHMENT) == 0) {
|
||||||
const char *filename = g_mime_part_get_filename (GMIME_PART (node->part));
|
const char *filename = g_mime_part_get_filename (GMIME_PART (node->part));
|
||||||
printf ("Attachment: %s (%s)\n", filename,
|
printf ("Attachment: %s (%s)\n", filename,
|
||||||
g_mime_content_type_to_string (content_type));
|
g_mime_content_type_to_string (content_type));
|
||||||
|
|
|
@ -456,7 +456,8 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,
|
||||||
g_mime_part_get_filename (GMIME_PART (node->part)) : NULL;
|
g_mime_part_get_filename (GMIME_PART (node->part)) : NULL;
|
||||||
|
|
||||||
if (disposition &&
|
if (disposition &&
|
||||||
strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)
|
strcasecmp (g_mime_content_disposition_get_disposition (disposition),
|
||||||
|
GMIME_DISPOSITION_ATTACHMENT) == 0)
|
||||||
part_type = "attachment";
|
part_type = "attachment";
|
||||||
else
|
else
|
||||||
part_type = "part";
|
part_type = "part";
|
||||||
|
|
Loading…
Reference in a new issue