unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v2 0/2] include Reply-To headers in json output
@ 2012-10-30 10:12 Peter Wang
  2012-10-30 10:12 ` [PATCH v2 1/2] show: include Reply-To header " Peter Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Wang @ 2012-10-30 10:12 UTC (permalink / raw)
  To: notmuch

This obsoletes the series 1340508470-16606-1-git-send-email-novalazy@gmail.com
Only json output is affected now.

Peter Wang (2):
  show: include Reply-To header in json output
  test: add test for showing Reply-To headers

 notmuch-show.c | 7 +++++++
 test/json      | 8 ++++----
 2 files changed, 11 insertions(+), 4 deletions(-)

-- 
1.7.12.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH v2 1/2] show: include Reply-To header in json output
  2012-10-30 10:12 [PATCH v2 0/2] include Reply-To headers in json output Peter Wang
@ 2012-10-30 10:12 ` Peter Wang
  2012-11-07 12:09   ` David Bremner
  2012-10-30 10:12 ` [PATCH v2 2/2] test: add test for showing Reply-To headers Peter Wang
  2012-11-06  3:58 ` [PATCH v2 0/2] include Reply-To headers in json output Ethan Glasser-Camp
  2 siblings, 1 reply; 5+ messages in thread
From: Peter Wang @ 2012-10-30 10:12 UTC (permalink / raw)
  To: notmuch

Output the Reply-To header field if present in a message.
I want to be able to see what the sender intended in my mail client,
before hitting the reply key.  Only json output is changed,
like the recently added Bcc field.
---
 notmuch-show.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/notmuch-show.c b/notmuch-show.c
index 0b7abf1..f758f56 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -210,6 +210,7 @@ format_headers_json (sprinter_t *sp, GMimeMessage *message,
 {
     InternetAddressList *recipients;
     const char *recipients_string;
+    const char *reply_to_string;
 
     sp->begin_map (sp);
 
@@ -240,6 +241,12 @@ format_headers_json (sprinter_t *sp, GMimeMessage *message,
 	sp->string (sp, recipients_string);
     }
 
+    reply_to_string = g_mime_message_get_reply_to (message);
+    if (reply_to_string) {
+	sp->map_key (sp, "Reply-To");
+	sp->string (sp, reply_to_string);
+    }
+
     if (reply) {
 	sp->map_key (sp, "In-reply-to");
 	sp->string (sp, g_mime_object_get_header (GMIME_OBJECT (message), "In-reply-to"));
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH v2 2/2] test: add test for showing Reply-To headers
  2012-10-30 10:12 [PATCH v2 0/2] include Reply-To headers in json output Peter Wang
  2012-10-30 10:12 ` [PATCH v2 1/2] show: include Reply-To header " Peter Wang
@ 2012-10-30 10:12 ` Peter Wang
  2012-11-06  3:58 ` [PATCH v2 0/2] include Reply-To headers in json output Ethan Glasser-Camp
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Wang @ 2012-10-30 10:12 UTC (permalink / raw)
  To: notmuch

Test that show --format=json now outputs Reply-To header fields when
present.
---
 test/json | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/test/json b/test/json
index 40d0ba3..bfafd55 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 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[body]=\"json-show-message\""
+add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[bcc]=\"test_suite+bcc@notmuchmail.org\"" "[reply-to]=\"test_suite+replyto@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_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"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_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"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_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\",\"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"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_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"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_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\",\"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]"
+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_suite@notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite@notmuchmail.org>\", \"Bcc\": \"test_suite+bcc@notmuchmail.org\", \"Reply-To\": \"test_suite+replyto@notmuchmail.org\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}}, []]]]"
 
 test_begin_subtest "Search message: json"
 add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\""
-- 
1.7.12.1

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 0/2] include Reply-To headers in json output
  2012-10-30 10:12 [PATCH v2 0/2] include Reply-To headers in json output Peter Wang
  2012-10-30 10:12 ` [PATCH v2 1/2] show: include Reply-To header " Peter Wang
  2012-10-30 10:12 ` [PATCH v2 2/2] test: add test for showing Reply-To headers Peter Wang
@ 2012-11-06  3:58 ` Ethan Glasser-Camp
  2 siblings, 0 replies; 5+ messages in thread
From: Ethan Glasser-Camp @ 2012-11-06  3:58 UTC (permalink / raw)
  To: Peter Wang, notmuch

Peter Wang <novalazy@gmail.com> writes:

> This obsoletes the series 1340508470-16606-1-git-send-email-novalazy@gmail.com
> Only json output is affected now.
>
> Peter Wang (2):
>   show: include Reply-To header in json output
>   test: add test for showing Reply-To headers

LGTM. Removed needs-review, added notmuch::trivial.

Ethan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2 1/2] show: include Reply-To header in json output
  2012-10-30 10:12 ` [PATCH v2 1/2] show: include Reply-To header " Peter Wang
@ 2012-11-07 12:09   ` David Bremner
  0 siblings, 0 replies; 5+ messages in thread
From: David Bremner @ 2012-11-07 12:09 UTC (permalink / raw)
  To: Peter Wang, notmuch

Peter Wang <novalazy@gmail.com> writes:

> Output the Reply-To header field if present in a message.
> I want to be able to see what the sender intended in my mail client,
> before hitting the reply key.  Only json output is changed,
> like the recently added Bcc field.

Pushed, 

d

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-11-07 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-30 10:12 [PATCH v2 0/2] include Reply-To headers in json output Peter Wang
2012-10-30 10:12 ` [PATCH v2 1/2] show: include Reply-To header " Peter Wang
2012-11-07 12:09   ` David Bremner
2012-10-30 10:12 ` [PATCH v2 2/2] test: add test for showing Reply-To headers Peter Wang
2012-11-06  3:58 ` [PATCH v2 0/2] include Reply-To headers in json output Ethan Glasser-Camp

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).