]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-show.c
added syntax files for search and show screens
[notmuch] / notmuch-show.c
index a764e4438e678739a670625a42bb2de4a6a2a99b..edebacaa571a3ba44a089fa671300e71f8c530cb 100644 (file)
@@ -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));
@@ -221,7 +228,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 +238,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))
     {