X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-show.c;h=13c91e47f17cee399d881af125ad2907916c5d56;hp=a764e4438e678739a670625a42bb2de4a6a2a99b;hb=de064f177202b8e7ec4073eef24b17f91eba11c8;hpb=f379aa52845f5594aa6cc2e7cf131d5f57202bbf diff --git a/notmuch-show.c b/notmuch-show.c index a764e443..13c91e47 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -72,12 +72,19 @@ show_part_content (GMimeObject *part) GMimeStream *stream_stdout = g_mime_stream_file_new (stdout); GMimeStream *stream_filter = NULL; GMimeDataWrapper *wrapper; + const char *charset; + + charset = g_mime_object_get_content_type_parameter (part, "charset"); if (stream_stdout) { g_mime_stream_file_set_owner (GMIME_STREAM_FILE (stream_stdout), FALSE); stream_filter = g_mime_stream_filter_new(stream_stdout); g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter), g_mime_filter_crlf_new(FALSE, FALSE)); + if (charset) { + g_mime_stream_filter_add(GMIME_STREAM_FILTER(stream_filter), + g_mime_filter_charset_new(charset, "UTF-8")); + } } wrapper = g_mime_part_get_content_object (GMIME_PART (part)); @@ -148,9 +155,10 @@ show_message (void *ctx, notmuch_message_t *message, int indent) const char *name, *value; unsigned int i; - printf ("\fmessage{ id:%s depth:%d filename:%s\n", + printf ("\fmessage{ id:%s depth:%d match:%d filename:%s\n", notmuch_message_get_message_id (message), indent, + notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_MATCH), notmuch_message_get_filename (message)); printf ("\fheader{\n"); @@ -221,7 +229,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) } notmuch = notmuch_database_open (notmuch_config_get_database_path (config), - NOTMUCH_DATABASE_MODE_READONLY); + NOTMUCH_DATABASE_MODE_READ_ONLY); if (notmuch == NULL) return 1; @@ -231,7 +239,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[])) return 1; } - for (threads = notmuch_query_search_threads (query, 0, -1); + for (threads = notmuch_query_search_threads (query); notmuch_threads_has_more (threads); notmuch_threads_advance (threads)) {