[PATCHv3] notmuch-show: include Bcc header in json output

2012-10-22 Thread David Bremner
Michal Nazarewicz  writes:

> From: Michal Nazarewicz 
>
> With this change, emacs users can use notmuch-message-headers
> variable to configure notmuch-show display Bcc header.

Pushed; a small patch for NEWS would be good.

d


Re: [PATCHv3] notmuch-show: include Bcc header in json output

2012-10-22 Thread David Bremner
Michal Nazarewicz m...@google.com writes:

 From: Michal Nazarewicz min...@mina86.com

 With this change, emacs users can use notmuch-message-headers
 variable to configure notmuch-show display Bcc header.

Pushed; a small patch for NEWS would be good.

d
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCHv3] notmuch-show: include Bcc header in json output

2012-10-20 Thread Ethan Glasser-Camp
Michal Nazarewicz  writes:

> From: Michal Nazarewicz 
>
> With this change, emacs users can use notmuch-message-headers
> variable to configure notmuch-show display Bcc header.
> ---

This patch looks pretty straightforward and has seen a certain amount of
review so I'm taking off needs-review.

Ethan


Re: [PATCHv3] notmuch-show: include Bcc header in json output

2012-10-20 Thread Ethan Glasser-Camp
Michal Nazarewicz m...@google.com writes:

 From: Michal Nazarewicz min...@mina86.com

 With this change, emacs users can use notmuch-message-headers
 variable to configure notmuch-show display Bcc header.
 ---

This patch looks pretty straightforward and has seen a certain amount of
review so I'm taking off needs-review.

Ethan
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Tomi Ollila
On Mon, Sep 10 2012, Michal Nazarewicz  wrote:

> On Mon, Sep 10 2012, Tomi Ollila wrote:
>> Thanks, that explains (also why my attempts to show Message-ID has
>> failed ;)
>
> Yeah.  Message ID is the other header I'm missing.  It should be
> possible to add it the same way though.

Actually, I'm happy with keybinding c i (and c I) to get Message-Id, so
I don't have desire for it (anymore). The Bcc is much more desirable
as it completes the info seen in  To and Cc headers... Just that I don't
know how notmuch chooses which mail to present when the mail in "sent" and
"received" folders have same message-id but only sent has the bcc: field.

> Best regards, _ _
...
> ..o | Computer Science,  Micha? ?mina86? Nazarewicz(o o)
...

Tomi



[PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Tomi Ollila
On Mon, Sep 10 2012, Michal Nazarewicz  wrote:

> From: Michal Nazarewicz 
>
> With this change, emacs users can use notmuch-message-headers
> variable to configure notmuch-show display Bcc header.
> ---

Thanks, that explains (also why my attempts to show Message-ID has failed ;)

I applied the patch, run tests (which pass) and tested the feature --
The Bcc field is indeed shown.

The only annoyance for me is that in the file I picked to test had:

BCC: user1 at host.tld, user2 at host.tld,
 user3 at host.tld, user4 at host.tld

notmuch displayed this content as

 Bcc: user1 at host.tld, user2 at host.tld,
user3 at host.tld, user4 at host.tld

I think this should be "fixed" (somehow (*)) in the future, but this
should not hold this patch.

+1

Tomi

(*) How that is done is another issue, should the cli or emacs do it,
(i.e. which interface modifies spacing information) and should this be done
generally to all headers. Is the solution to change all whitespace to one
space or indent subsequent on screen...

>  notmuch-show.c   |7 +++
>  test/json|8 
>  test/test-lib.sh |5 +
>  3 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/notmuch-show.c b/notmuch-show.c
> index 3556293..0b7abf1 100644
> --- a/notmuch-show.c
> +++ b/notmuch-show.c
> @@ -233,6 +233,13 @@ format_headers_json (sprinter_t *sp, GMimeMessage 
> *message,
>   sp->string (sp, recipients_string);
>  }
>  
> +recipients = g_mime_message_get_recipients (message, 
> GMIME_RECIPIENT_TYPE_BCC);
> +recipients_string = internet_address_list_to_string (recipients, 0);
> +if (recipients_string) {
> + sp->map_key (sp, "Bcc");
> + sp->string (sp, recipients_string);
> +}
> +
>  if (reply) {
>   sp->map_key (sp, "In-reply-to");
>   sp->string (sp, g_mime_object_get_header (GMIME_OBJECT (message), 
> "In-reply-to"));
> diff --git a/test/json b/test/json
> index ac8fa8e..40d0ba3 100755
> --- a/test/json
> +++ b/test/json
> @@ -3,18 +3,18 @@ test_description="--format=json output"
>  . ./test-lib.sh
>  
>  test_begin_subtest "Show message: json"
> -add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 
> 12:00:00 -\"" "[body]=\"json-show-message\""
> +add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 
> 12:00:00 -\"" "[bcc]=\"test_suite+bcc at notmuchmail.org\"" 
> "[body]=\"json-show-message\""
>  output=$(notmuch show --format=json "json-show-message")
> -test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
> true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
> \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
> [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
> \"From\": \"Notmuch Test Suite \", \"To\": 
> \"Notmuch Test Suite \", \"Date\": \"Sat, 01 
> Jan 2000 12:00:00 +\"}, \"body\": [{\"id\": 1, \"content-type\": 
> \"text/plain\", \"content\": \"json-show-message\n\"}]}, ["
> +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
> true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
> \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
> [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
> \"From\": \"Notmuch Test Suite \", \"To\": 
> \"Notmuch Test Suite \", \"Bcc\": 
> \"test_suite+bcc at notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 
> +\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", 
> \"content\": \"json-show-message\n\"}]}, ["
>  
>  # This should be the same output as above.
>  test_begin_subtest "Show message: json --body=true"
>  output=$(notmuch show --format=json --body=true "json-show-message")
> -test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
> true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
> \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
> [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
> \"From\": \"Notmuch Test Suite \", \"To\": 
> \"Notmuch Test Suite \", \"Date\": \"Sat, 01 
> Jan 2000 12:00:00 +\"}, \"body\": [{\"id\": 1, \"content-type\": 
> \"text/plain\", \"content\": \"json-show-message\n\"}]}, ["
> +test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
> true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
> \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
> [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
> \"From\": \"Notmuch Test Suite \", \"To\": 
> \"Notmuch Test Suite \", \"Bcc\": 
> \"test_suite+bcc at notmuchmail.org\",\"Date\": \"Sat, 01 Jan 2000 12:00:00 
> +\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", 
> \"content\": \"json-show-message\n\"}]}, ["
>  
>  test_begin_subtest "Show message: json --body=false"
>  output=$(notmuch show --format=json 

[PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Michal Nazarewicz
On Mon, Sep 10 2012, Tomi Ollila wrote:
> Actually, I'm happy with keybinding c i (and c I) to get Message-Id, 

Ah, great!  That solves it, thanks. :)

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Micha? ?mina86? Nazarewicz(o o)
ooo +--ooO--(_)--Ooo--
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



[PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Michal Nazarewicz
On Mon, Sep 10 2012, Tomi Ollila wrote:
> Thanks, that explains (also why my attempts to show Message-ID has
> failed ;)

Yeah.  Message ID is the other header I'm missing.  It should be
possible to add it the same way though.

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Micha? ?mina86? Nazarewicz(o o)
ooo +--ooO--(_)--Ooo--
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: 



[PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Michal Nazarewicz
From: Michal Nazarewicz 

With this change, emacs users can use notmuch-message-headers
variable to configure notmuch-show display Bcc header.
---
 notmuch-show.c   |7 +++
 test/json|8 
 test/test-lib.sh |5 +
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index 3556293..0b7abf1 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -233,6 +233,13 @@ format_headers_json (sprinter_t *sp, GMimeMessage *message,
sp->string (sp, recipients_string);
 }

+recipients = g_mime_message_get_recipients (message, 
GMIME_RECIPIENT_TYPE_BCC);
+recipients_string = internet_address_list_to_string (recipients, 0);
+if (recipients_string) {
+   sp->map_key (sp, "Bcc");
+   sp->string (sp, recipients_string);
+}
+
 if (reply) {
sp->map_key (sp, "In-reply-to");
sp->string (sp, g_mime_object_get_header (GMIME_OBJECT (message), 
"In-reply-to"));
diff --git a/test/json b/test/json
index ac8fa8e..40d0ba3 100755
--- a/test/json
+++ b/test/json
@@ -3,18 +3,18 @@ test_description="--format=json output"
 . ./test-lib.sh

 test_begin_subtest "Show message: json"
-add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 
12:00:00 -\"" "[body]=\"json-show-message\""
+add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 
12:00:00 -\"" "[bcc]=\"test_suite+bcc at notmuchmail.org\"" 
"[body]=\"json-show-message\""
 output=$(notmuch show --format=json "json-show-message")
-test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
\"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
[\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
\"From\": \"Notmuch Test Suite \", \"To\": 
\"Notmuch Test Suite \", \"Date\": \"Sat, 01 Jan 
2000 12:00:00 +\"}, \"body\": [{\"id\": 1, \"content-type\": 
\"text/plain\", \"content\": \"json-show-message\n\"}]}, ["
+test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
\"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
[\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
\"From\": \"Notmuch Test Suite \", \"To\": 
\"Notmuch Test Suite \", \"Bcc\": 
\"test_suite+bcc at notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 
+\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": 
\"json-show-message\n\"}]}, ["

 # This should be the same output as above.
 test_begin_subtest "Show message: json --body=true"
 output=$(notmuch show --format=json --body=true "json-show-message")
-test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
\"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
[\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
\"From\": \"Notmuch Test Suite \", \"To\": 
\"Notmuch Test Suite \", \"Date\": \"Sat, 01 Jan 
2000 12:00:00 +\"}, \"body\": [{\"id\": 1, \"content-type\": 
\"text/plain\", \"content\": \"json-show-message\n\"}]}, ["
+test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
\"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
[\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
\"From\": \"Notmuch Test Suite \", \"To\": 
\"Notmuch Test Suite \", \"Bcc\": 
\"test_suite+bcc at notmuchmail.org\",\"Date\": \"Sat, 01 Jan 2000 12:00:00 
+\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": 
\"json-show-message\n\"}]}, ["

 test_begin_subtest "Show message: json --body=false"
 output=$(notmuch show --format=json --body=false "json-show-message")
-test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
\"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
[\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
\"From\": \"Notmuch Test Suite \", \"To\": 
\"Notmuch Test Suite \", \"Date\": \"Sat, 01 Jan 
2000 12:00:00 +\"}}, ["
+test_expect_equal_json "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": 
true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", 
\"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": 
[\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", 
\"From\": \"Notmuch Test Suite \", \"To\": 
\"Notmuch Test Suite \", \"Bcc\": 
\"test_suite+bcc at notmuchmail.org\",\"Date\": \"Sat, 01 Jan 2000 12:00:00 
+\"}}, ["

 test_begin_subtest "Search message: json"
 add_message "[subject]=\"json-search-subject\"" 

[PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Michal Nazarewicz
From: Michal Nazarewicz min...@mina86.com

With this change, emacs users can use notmuch-message-headers
variable to configure notmuch-show display Bcc header.
---
 notmuch-show.c   |7 +++
 test/json|8 
 test/test-lib.sh |5 +
 3 files changed, 16 insertions(+), 4 deletions(-)

diff --git a/notmuch-show.c b/notmuch-show.c
index 3556293..0b7abf1 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -233,6 +233,13 @@ format_headers_json (sprinter_t *sp, GMimeMessage *message,
sp-string (sp, recipients_string);
 }
 
+recipients = g_mime_message_get_recipients (message, 
GMIME_RECIPIENT_TYPE_BCC);
+recipients_string = internet_address_list_to_string (recipients, 0);
+if (recipients_string) {
+   sp-map_key (sp, Bcc);
+   sp-string (sp, recipients_string);
+}
+
 if (reply) {
sp-map_key (sp, In-reply-to);
sp-string (sp, g_mime_object_get_header (GMIME_OBJECT (message), 
In-reply-to));
diff --git a/test/json b/test/json
index ac8fa8e..40d0ba3 100755
--- a/test/json
+++ b/test/json
@@ -3,18 +3,18 @@ test_description=--format=json output
 . ./test-lib.sh
 
 test_begin_subtest Show message: json
-add_message [subject]=\json-show-subject\ [date]=\Sat, 01 Jan 2000 
12:00:00 -\ [body]=\json-show-message\
+add_message [subject]=\json-show-subject\ [date]=\Sat, 01 Jan 2000 
12:00:00 -\ [bcc]=\test_suite+...@notmuchmail.org\ 
[body]=\json-show-message\
 output=$(notmuch show --format=json json-show-message)
-test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
\timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
[\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
\From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
\Notmuch Test Suite test_su...@notmuchmail.org\, \Date\: \Sat, 01 Jan 
2000 12:00:00 +\}, \body\: [{\id\: 1, \content-type\: 
\text/plain\, \content\: \json-show-message\n\}]}, [
+test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
\timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
[\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
\From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
\Notmuch Test Suite test_su...@notmuchmail.org\, \Bcc\: 
\test_suite+...@notmuchmail.org\, \Date\: \Sat, 01 Jan 2000 12:00:00 
+\}, \body\: [{\id\: 1, \content-type\: \text/plain\, \content\: 
\json-show-message\n\}]}, [
 
 # This should be the same output as above.
 test_begin_subtest Show message: json --body=true
 output=$(notmuch show --format=json --body=true json-show-message)
-test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
\timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
[\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
\From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
\Notmuch Test Suite test_su...@notmuchmail.org\, \Date\: \Sat, 01 Jan 
2000 12:00:00 +\}, \body\: [{\id\: 1, \content-type\: 
\text/plain\, \content\: \json-show-message\n\}]}, [
+test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
\timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
[\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
\From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
\Notmuch Test Suite test_su...@notmuchmail.org\, \Bcc\: 
\test_suite+...@notmuchmail.org\,\Date\: \Sat, 01 Jan 2000 12:00:00 
+\}, \body\: [{\id\: 1, \content-type\: \text/plain\, \content\: 
\json-show-message\n\}]}, [
 
 test_begin_subtest Show message: json --body=false
 output=$(notmuch show --format=json --body=false json-show-message)
-test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
\timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
[\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
\From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
\Notmuch Test Suite test_su...@notmuchmail.org\, \Date\: \Sat, 01 Jan 
2000 12:00:00 +\}}, [
+test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
\timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
[\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
\From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
\Notmuch Test Suite test_su...@notmuchmail.org\, \Bcc\: 
\test_suite+...@notmuchmail.org\,\Date\: \Sat, 01 Jan 2000 12:00:00 
+\}}, [
 
 test_begin_subtest Search message: json
 add_message [subject]=\json-search-subject\ [date]=\Sat, 01 Jan 2000 
12:00:00 -\ [body]=\json-search-message\
diff --git 

Re: [PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Tomi Ollila
On Mon, Sep 10 2012, Michal Nazarewicz m...@google.com wrote:

 From: Michal Nazarewicz min...@mina86.com

 With this change, emacs users can use notmuch-message-headers
 variable to configure notmuch-show display Bcc header.
 ---

Thanks, that explains (also why my attempts to show Message-ID has failed ;)

I applied the patch, run tests (which pass) and tested the feature --
The Bcc field is indeed shown.

The only annoyance for me is that in the file I picked to test had:

BCC: us...@host.tld, us...@host.tld,
 us...@host.tld, us...@host.tld

notmuch displayed this content as

 Bcc: us...@host.tld, us...@host.tld,
us...@host.tld, us...@host.tld

I think this should be fixed (somehow (*)) in the future, but this
should not hold this patch.

+1

Tomi

(*) How that is done is another issue, should the cli or emacs do it,
(i.e. which interface modifies spacing information) and should this be done
generally to all headers. Is the solution to change all whitespace to one
space or indent subsequent on screen...

  notmuch-show.c   |7 +++
  test/json|8 
  test/test-lib.sh |5 +
  3 files changed, 16 insertions(+), 4 deletions(-)

 diff --git a/notmuch-show.c b/notmuch-show.c
 index 3556293..0b7abf1 100644
 --- a/notmuch-show.c
 +++ b/notmuch-show.c
 @@ -233,6 +233,13 @@ format_headers_json (sprinter_t *sp, GMimeMessage 
 *message,
   sp-string (sp, recipients_string);
  }
  
 +recipients = g_mime_message_get_recipients (message, 
 GMIME_RECIPIENT_TYPE_BCC);
 +recipients_string = internet_address_list_to_string (recipients, 0);
 +if (recipients_string) {
 + sp-map_key (sp, Bcc);
 + sp-string (sp, recipients_string);
 +}
 +
  if (reply) {
   sp-map_key (sp, In-reply-to);
   sp-string (sp, g_mime_object_get_header (GMIME_OBJECT (message), 
 In-reply-to));
 diff --git a/test/json b/test/json
 index ac8fa8e..40d0ba3 100755
 --- a/test/json
 +++ b/test/json
 @@ -3,18 +3,18 @@ test_description=--format=json output
  . ./test-lib.sh
  
  test_begin_subtest Show message: json
 -add_message [subject]=\json-show-subject\ [date]=\Sat, 01 Jan 2000 
 12:00:00 -\ [body]=\json-show-message\
 +add_message [subject]=\json-show-subject\ [date]=\Sat, 01 Jan 2000 
 12:00:00 -\ [bcc]=\test_suite+...@notmuchmail.org\ 
 [body]=\json-show-message\
  output=$(notmuch show --format=json json-show-message)
 -test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
 true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
 \timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
 [\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
 \From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
 \Notmuch Test Suite test_su...@notmuchmail.org\, \Date\: \Sat, 01 Jan 
 2000 12:00:00 +\}, \body\: [{\id\: 1, \content-type\: 
 \text/plain\, \content\: \json-show-message\n\}]}, [
 +test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
 true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
 \timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
 [\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
 \From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
 \Notmuch Test Suite test_su...@notmuchmail.org\, \Bcc\: 
 \test_suite+...@notmuchmail.org\, \Date\: \Sat, 01 Jan 2000 12:00:00 
 +\}, \body\: [{\id\: 1, \content-type\: \text/plain\, 
 \content\: \json-show-message\n\}]}, [
  
  # This should be the same output as above.
  test_begin_subtest Show message: json --body=true
  output=$(notmuch show --format=json --body=true json-show-message)
 -test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
 true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
 \timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
 [\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
 \From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
 \Notmuch Test Suite test_su...@notmuchmail.org\, \Date\: \Sat, 01 Jan 
 2000 12:00:00 +\}, \body\: [{\id\: 1, \content-type\: 
 \text/plain\, \content\: \json-show-message\n\}]}, [
 +test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
 true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
 \timestamp\: 946728000, \date_relative\: \2000-01-01\, \tags\: 
 [\inbox\,\unread\], \headers\: {\Subject\: \json-show-subject\, 
 \From\: \Notmuch Test Suite test_su...@notmuchmail.org\, \To\: 
 \Notmuch Test Suite test_su...@notmuchmail.org\, \Bcc\: 
 \test_suite+...@notmuchmail.org\,\Date\: \Sat, 01 Jan 2000 12:00:00 
 +\}, \body\: [{\id\: 1, \content-type\: \text/plain\, 
 \content\: \json-show-message\n\}]}, [
  
  test_begin_subtest Show message: json --body=false
  output=$(notmuch show --format=json --body=false json-show-message)
 -test_expect_equal_json $output [[[{\id\: \${gen_msg_id}\, \match\: 
 true, \excluded\: false, \filename\: \${gen_msg_filename}\, 
 \timestamp\: 

Re: [PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Michal Nazarewicz
On Mon, Sep 10 2012, Tomi Ollila wrote:
 Thanks, that explains (also why my attempts to show Message-ID has
 failed ;)

Yeah.  Message ID is the other header I'm missing.  It should be
possible to add it the same way though.

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +email/xmpp: m...@google.com--ooO--(_)--Ooo--

pgpz7COsKkt4w.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Tomi Ollila
On Mon, Sep 10 2012, Michal Nazarewicz m...@google.com wrote:

 On Mon, Sep 10 2012, Tomi Ollila wrote:
 Thanks, that explains (also why my attempts to show Message-ID has
 failed ;)

 Yeah.  Message ID is the other header I'm missing.  It should be
 possible to add it the same way though.

Actually, I'm happy with keybinding c i (and c I) to get Message-Id, so
I don't have desire for it (anymore). The Bcc is much more desirable
as it completes the info seen in  To and Cc headers... Just that I don't
know how notmuch chooses which mail to present when the mail in sent and
received folders have same message-id but only sent has the bcc: field.

 Best regards, _ _
...
 ..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
...

Tomi

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Re: [PATCHv3] notmuch-show: include Bcc header in json output

2012-09-10 Thread Michal Nazarewicz
On Mon, Sep 10 2012, Tomi Ollila wrote:
 Actually, I'm happy with keybinding c i (and c I) to get Message-Id, 

Ah, great!  That solves it, thanks. :)

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +email/xmpp: m...@google.com--ooO--(_)--Ooo--

pgpF8nVVxLvKH.pgp
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch