X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-reply.c;h=3c6d685cbd6054c68a0281e696e747c8045aff57;hp=4464741fe3567e974e6f07038b93f6446b744150;hb=8a75fcfa7b90151a7c1b1cf58366a8fc1fd8b70c;hpb=8cca886b10c5ec44f3214701c0c1e3c896d53d5c diff --git a/notmuch-reply.c b/notmuch-reply.c index 4464741f..3c6d685c 100644 --- a/notmuch-reply.c +++ b/notmuch-reply.c @@ -80,7 +80,8 @@ format_part_reply (mime_node_t *node) show_text_part_content (node->part, stream_stdout, NOTMUCH_SHOW_TEXT_PART_REPLY); g_object_unref(stream_stdout); } 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)); printf ("Attachment: %s (%s)\n", filename, g_mime_content_type_to_string (content_type)); @@ -331,7 +332,7 @@ add_recipients_from_message (GMimeMessage *reply, * field and use the From header. This ensures the original sender * will get the reply even if not subscribed to the list. Note * that the address in the Reply-To header will always appear in - * the reply. + * the reply if reply_all is true. */ if (reply_to_header_is_redundant (message)) { reply_to_map[0].header = "from"; @@ -606,8 +607,13 @@ notmuch_reply_format_default(void *ctx, notmuch_messages_t *messages; notmuch_message_t *message; mime_node_t *root; + notmuch_status_t status; - for (messages = notmuch_query_search_messages (query); + status = notmuch_query_search_messages_st (query, &messages); + if (print_status_query ("notmuch reply", query, status)) + return 1; + + for (; notmuch_messages_valid (messages); notmuch_messages_move_to_next (messages)) { @@ -650,13 +656,22 @@ notmuch_reply_format_sprinter(void *ctx, notmuch_messages_t *messages; notmuch_message_t *message; mime_node_t *node; + unsigned count; + notmuch_status_t status; - if (notmuch_query_count_messages (query) != 1) { + status = notmuch_query_count_messages_st (query, &count); + if (print_status_query ("notmuch reply", query, status)) + return 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 reply", query, status)) + return 1; + message = notmuch_messages_get (messages); if (mime_node_open (ctx, message, &(params->crypto), &node) != NOTMUCH_STATUS_SUCCESS) return 1; @@ -698,8 +713,13 @@ notmuch_reply_format_headers_only(void *ctx, notmuch_message_t *message; const char *in_reply_to, *orig_references, *references; char *reply_headers; + notmuch_status_t status; + + status = notmuch_query_search_messages_st (query, &messages); + if (print_status_query ("notmuch reply", query, status)) + return 1; - for (messages = notmuch_query_search_messages (query); + for (; notmuch_messages_valid (messages); notmuch_messages_move_to_next (messages)) { @@ -831,6 +851,8 @@ notmuch_reply_command (notmuch_config_t *config, int argc, char *argv[]) NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) return EXIT_FAILURE; + notmuch_exit_if_unmatched_db_uuid (notmuch); + query = notmuch_query_create (notmuch, query_string); if (query == NULL) { fprintf (stderr, "Out of memory\n");