From: Peter Wang Date: Tue, 30 Oct 2012 10:12:46 +0000 (+1100) Subject: [PATCH v2 1/2] show: include Reply-To header in json output X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=c89b1d15f65b1be352caae831f4e23f326f0399a;p=notmuch-archives.git [PATCH v2 1/2] show: include Reply-To header in json output --- diff --git a/3e/b9f75cc1c4c9d380cf8965ded4166c778ab096 b/3e/b9f75cc1c4c9d380cf8965ded4166c778ab096 new file mode 100644 index 000000000..15c1ce58a --- /dev/null +++ b/3e/b9f75cc1c4c9d380cf8965ded4166c778ab096 @@ -0,0 +1,98 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 772BC431FBC + for ; Tue, 30 Oct 2012 03:13:20 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.799 +X-Spam-Level: +X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 9+4opW1UyQfd for ; + Tue, 30 Oct 2012 03:13:20 -0700 (PDT) +Received: from mail-pb0-f53.google.com (mail-pb0-f53.google.com + [209.85.160.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 0DCAF431FAF + for ; Tue, 30 Oct 2012 03:13:19 -0700 (PDT) +Received: by mail-pb0-f53.google.com with SMTP id wz12so83419pbc.26 + for ; Tue, 30 Oct 2012 03:13:19 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; + bh=WKilJ/kbLYgPU+iQuyeOvlmU6wvs36NJlfzloqWS+5Q=; + b=cuAZww0CQiRUEDVYNasiflzUC8yZw80/xhS2LWqldNp8qPswGHzmYs+Jkn+x/f6WGc + YoRx1/XwAyp709Nx0Z0btlaR4s05uQLP9TUQSxnxmX+u9/HA4XxSP7luys6Wt3vQ2EQT + 6YT2fJMlX5LyQTvSJT5ImjZa0tKIufc4uy5XD9xr3VHvRswvbjpp7svpN2gRgUMh9FVN + UfKnuV6H+R/7fmk/7j5Fb5HIWVf0E8b3QBXCJX+i+3TRc/Qzn6PDJzXY6dVnjxkY2nlC + Ba8iCtcDfwPhdjXEM1AjwyFIodyBj9nfDwldWcIEOdT7ujOlc8dpb4Nobzk+nm9otxWj + VP6A== +Received: by 10.68.228.130 with SMTP id si2mr82749405pbc.126.1351591999326; + Tue, 30 Oct 2012 03:13:19 -0700 (PDT) +Received: from localhost (215.42.233.220.static.exetel.com.au. + [220.233.42.215]) + by mx.google.com with ESMTPS id az8sm176798pab.24.2012.10.30.03.13.16 + (version=TLSv1/SSLv3 cipher=OTHER); + Tue, 30 Oct 2012 03:13:18 -0700 (PDT) +From: Peter Wang +To: notmuch@notmuchmail.org +Subject: [PATCH v2 1/2] show: include Reply-To header in json output +Date: Tue, 30 Oct 2012 21:12:46 +1100 +Message-Id: <1351591967-17438-2-git-send-email-novalazy@gmail.com> +X-Mailer: git-send-email 1.7.12.1 +In-Reply-To: <1351591967-17438-1-git-send-email-novalazy@gmail.com> +References: <1351591967-17438-1-git-send-email-novalazy@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 30 Oct 2012 10:13:20 -0000 + +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 +