[PATCH 11/11] lib: add recipients to database
authorJameson Graef Rollins <jrollins@finestructure.net>
Mon, 20 Aug 2012 01:52:50 +0000 (18:52 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:09 +0000 (09:49 -0800)
56/a5561fa7231f46798648f73768a42ad9928a21 [new file with mode: 0644]

diff --git a/56/a5561fa7231f46798648f73768a42ad9928a21 b/56/a5561fa7231f46798648f73768a42ad9928a21
new file mode 100644 (file)
index 0000000..0b28430
--- /dev/null
@@ -0,0 +1,135 @@
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 16AC5431FBD\r
+       for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:17 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id x3k26Sy+AWBF for <notmuch@notmuchmail.org>;\r
+       Sun, 19 Aug 2012 18:53:15 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id C1C0D431FC9\r
+       for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:08 -0700 (PDT)\r
+Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by fire-doxen-postvirus (Postfix) with ESMTP id 0E3402E50D80\r
+       for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:08 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
+Received: from finestructure.net (unknown [76.89.192.57])\r
+       (Authenticated sender: jrollins)\r
+       by fire-doxen-submit (Postfix) with ESMTP id C7955328012\r
+       for <notmuch@notmuchmail.org>; Sun, 19 Aug 2012 18:53:05 -0700 (PDT)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id 0563ED19; Sun, 19 Aug 2012 18:53:04 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 11/11] lib: add recipients to database\r
+Date: Sun, 19 Aug 2012 18:52:50 -0700\r
+Message-Id: <1345427570-26518-12-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <1345427570-26518-11-git-send-email-jrollins@finestructure.net>\r
+References: <1345427570-26518-1-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-2-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-3-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-4-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-5-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-6-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-7-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-8-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-9-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-10-git-send-email-jrollins@finestructure.net>\r
+       <1345427570-26518-11-git-send-email-jrollins@finestructure.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 20 Aug 2012 01:53:17 -0000\r
+\r
+This adds just the "to" recipients, but probably "cc"s should be\r
+included as well.\r
+---\r
+ lib/database.cc       |    2 +-\r
+ lib/message.cc        |    4 ++++\r
+ lib/notmuch-private.h |    2 ++\r
+ 3 files changed, 7 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/lib/database.cc b/lib/database.cc\r
+index 761dc1a..4c1d578 100644\r
+--- a/lib/database.cc\r
++++ b/lib/database.cc\r
+@@ -1814,7 +1814,7 @@ notmuch_database_add_message (notmuch_database_t *notmuch,\r
+               goto DONE;\r
+ \r
+           date = notmuch_message_file_get_header (message_file, "date");\r
+-          _notmuch_message_set_header_values (message, date, from, subject);\r
++          _notmuch_message_set_header_values (message, date, from, to, subject);\r
+ \r
+           _notmuch_message_index_file (message, filename);\r
+       } else {\r
+diff --git a/lib/message.cc b/lib/message.cc\r
+index fa28073..cc5c8a0 100644\r
+--- a/lib/message.cc\r
++++ b/lib/message.cc\r
+@@ -420,6 +420,8 @@ notmuch_message_get_header (notmuch_message_t *message, const char *header)\r
+      * available */\r
+     if (strcasecmp (header, "from") == 0)\r
+       value = message->doc.get_value (NOTMUCH_VALUE_FROM);\r
++    if (strcasecmp (header, "to") == 0)\r
++      value = message->doc.get_value (NOTMUCH_VALUE_TO);\r
+     else if (strcasecmp (header, "subject") == 0)\r
+       value = message->doc.get_value (NOTMUCH_VALUE_SUBJECT);\r
+     else if (strcasecmp (header, "message-id") == 0)\r
+@@ -830,6 +832,7 @@ void\r
+ _notmuch_message_set_header_values (notmuch_message_t *message,\r
+                                   const char *date,\r
+                                   const char *from,\r
++                                  const char *to,\r
+                                   const char *subject)\r
+ {\r
+     time_t time_value;\r
+@@ -844,6 +847,7 @@ _notmuch_message_set_header_values (notmuch_message_t *message,\r
+     message->doc.add_value (NOTMUCH_VALUE_TIMESTAMP,\r
+                           Xapian::sortable_serialise (time_value));\r
+     message->doc.add_value (NOTMUCH_VALUE_FROM, from);\r
++    message->doc.add_value (NOTMUCH_VALUE_TO, to);\r
+     message->doc.add_value (NOTMUCH_VALUE_SUBJECT, subject);\r
+ }\r
+ \r
+diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
+index 32d1523..f56c580 100644\r
+--- a/lib/notmuch-private.h\r
++++ b/lib/notmuch-private.h\r
+@@ -95,6 +95,7 @@ typedef enum {\r
+     NOTMUCH_VALUE_TIMESTAMP = 0,\r
+     NOTMUCH_VALUE_MESSAGE_ID,\r
+     NOTMUCH_VALUE_FROM,\r
++    NOTMUCH_VALUE_TO,\r
+     NOTMUCH_VALUE_SUBJECT\r
+ } notmuch_value_t;\r
+ \r
+@@ -291,6 +292,7 @@ void\r
+ _notmuch_message_set_header_values (notmuch_message_t *message,\r
+                                   const char *date,\r
+                                   const char *from,\r
++                                  const char *to,\r
+                                   const char *subject);\r
+ void\r
+ _notmuch_message_sync (notmuch_message_t *message);\r
+-- \r
+1.7.10.4\r
+\r