]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-search.c
Merge tag 0.28.4
[notmuch] / notmuch-search.c
index 0abac08eb7ab3a2720fdeb7d3b67717dd833039f..e2dee4181b7400907723177e1cba687c8a9f21de 100644 (file)
@@ -34,6 +34,7 @@ typedef enum {
     OUTPUT_SENDER      = 1 << 5,
     OUTPUT_RECIPIENTS  = 1 << 6,
     OUTPUT_COUNT       = 1 << 7,
+    OUTPUT_ADDRESS     = 1 << 8,
 } output_t;
 
 typedef enum {
@@ -363,14 +364,17 @@ print_mailbox (const search_context_t *ctx, const mailbox_t *mailbox)
 
     /* name_addr has the name part quoted if necessary. Compare
      * 'John Doe <john@doe.com>' vs. '"Doe, John" <john@doe.com>' */
-    name_addr = internet_address_to_string (ia, false);
+    name_addr = internet_address_to_string (ia, NULL, false);
 
     if (format->is_text_printer) {
        if (ctx->output & OUTPUT_COUNT) {
            format->integer (format, count);
            format->string (format, "\t");
        }
-       format->string (format, name_addr);
+       if (ctx->output & OUTPUT_ADDRESS)
+           format->string (format, addr);
+       else
+           format->string (format, name_addr);
        format->separator (format);
     } else {
        format->begin_map (format);
@@ -442,7 +446,7 @@ process_address_header (const search_context_t *ctx, const char *value)
     if (value == NULL)
        return;
 
-    list = internet_address_list_parse_string (value);
+    list = internet_address_list_parse (NULL, value);
     if (list == NULL)
        return;
 
@@ -877,6 +881,7 @@ notmuch_address_command (notmuch_config_t *config, int argc, char *argv[])
          (notmuch_keyword_t []){ { "sender", OUTPUT_SENDER },
                                  { "recipients", OUTPUT_RECIPIENTS },
                                  { "count", OUTPUT_COUNT },
+                                 { "address", OUTPUT_ADDRESS },
                                  { 0, 0 } } },
        { .opt_keyword = &ctx->exclude, .name = "exclude", .keywords =
          (notmuch_keyword_t []){ { "true", NOTMUCH_EXCLUDE_TRUE },