X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-show.c;h=87e52bbc0e81a7f8b0c4c7ca5c374cfdbb5da068;hp=43560256a7c41a674f44882b10762f55460724dc;hb=1abc33833149f6c71850c1b6f4bdeca38c718023;hpb=005c2f0df17de8afdf9f67b923d26f2358236171 diff --git a/notmuch-show.c b/notmuch-show.c index 43560256..87e52bbc 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -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; if (disposition && - strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0) + strcasecmp (g_mime_content_disposition_get_disposition (disposition), + GMIME_DISPOSITION_ATTACHMENT) == 0) part_type = "attachment"; else part_type = "part"; @@ -895,13 +896,22 @@ do_show_single (void *ctx, { notmuch_messages_t *messages; notmuch_message_t *message; + notmuch_status_t status; + unsigned int count; + + status = notmuch_query_count_messages_st (query, &count); + if (print_status_query ("notmuch show", query, status)) + return 1; - if (notmuch_query_count_messages (query) != 1) { + if (count != 1) { fprintf (stderr, "Error: search term did not match precisely one message.\n"); return 1; } - messages = notmuch_query_search_messages (query); + status = notmuch_query_search_messages_st (query, &messages); + if (print_status_query ("notmuch show", query, status)) + return 1; + message = notmuch_messages_get (messages); if (message == NULL) { @@ -928,8 +938,8 @@ do_show (void *ctx, notmuch_messages_t *messages; notmuch_status_t status, res = NOTMUCH_STATUS_SUCCESS; - threads = notmuch_query_search_threads (query); - if (! threads) + status= notmuch_query_search_threads_st (query, &threads); + if (print_status_query ("notmuch show", query, status)) return 1; sp->begin_list (sp);