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 96CB0431FCB for ; Sun, 19 Aug 2012 18:53:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] 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 L7SPgE6WMATL for ; Sun, 19 Aug 2012 18:53:09 -0700 (PDT) Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu [131.215.239.19]) by olra.theworths.org (Postfix) with ESMTP id 0698A431FBF for ; Sun, 19 Aug 2012 18:53:08 -0700 (PDT) Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1]) by earth-doxen-postvirus (Postfix) with ESMTP id C5A7C66E00DE for ; Sun, 19 Aug 2012 18:53:07 -0700 (PDT) X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new Received: from finestructure.net (unknown [76.89.192.57]) (Authenticated sender: jrollins) by earth-doxen-submit (Postfix) with ESMTP id 99F9A66E00D1 for ; Sun, 19 Aug 2012 18:53:05 -0700 (PDT) Received: by finestructure.net (Postfix, from userid 1000) id D42D98E8; Sun, 19 Aug 2012 18:53:03 -0700 (PDT) From: Jameson Graef Rollins To: Notmuch Mail Subject: [PATCH 05/11] lib: add ability to store recipients in message structure Date: Sun, 19 Aug 2012 18:52:44 -0700 Message-Id: <1345427570-26518-6-git-send-email-jrollins@finestructure.net> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1345427570-26518-5-git-send-email-jrollins@finestructure.net> References: <1345427570-26518-1-git-send-email-jrollins@finestructure.net> <1345427570-26518-2-git-send-email-jrollins@finestructure.net> <1345427570-26518-3-git-send-email-jrollins@finestructure.net> <1345427570-26518-4-git-send-email-jrollins@finestructure.net> <1345427570-26518-5-git-send-email-jrollins@finestructure.net> 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: Mon, 20 Aug 2012 01:53:11 -0000 Added as a string, in parallel to the authors element. --- lib/message.cc | 18 ++++++++++++++++++ lib/notmuch-private.h | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/lib/message.cc b/lib/message.cc index 978de06..fa28073 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -36,6 +36,7 @@ struct visible _notmuch_message { notmuch_string_list_t *filename_term_list; notmuch_string_list_t *filename_list; char *author; + char *recipients; notmuch_message_file_t *message_file; notmuch_message_list_t *replies; unsigned long flags; @@ -109,6 +110,7 @@ _notmuch_message_create_for_document (const void *talloc_owner, message->filename_list = NULL; message->message_file = NULL; message->author = NULL; + message->recipients = NULL; message->replies = _notmuch_message_list_create (message); if (unlikely (message->replies == NULL)) { @@ -808,6 +810,22 @@ notmuch_message_set_author (notmuch_message_t *message, return; } +const char * +notmuch_message_get_recipients (notmuch_message_t *message) +{ + return message->recipients; +} + +void +notmuch_message_set_recipients (notmuch_message_t *message, + const char *recipients) +{ + if (message->recipients) + talloc_free(message->recipients); + message->recipients = talloc_strdup(message, recipients); + return; +} + void _notmuch_message_set_header_values (notmuch_message_t *message, const char *date, diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h index bfb4111..27a41b6 100644 --- a/lib/notmuch-private.h +++ b/lib/notmuch-private.h @@ -325,6 +325,15 @@ notmuch_message_set_author (notmuch_message_t *message, const char *author); const char * notmuch_message_get_author (notmuch_message_t *message); +/* Set the recipients of 'message' - this is the representation used + * when displaying the message */ +void +notmuch_message_set_recipients (notmuch_message_t *message, const char *recipients); + +/* Get the authors of 'message' */ +const char * +notmuch_message_get_recipients (notmuch_message_t *message); + /* index.cc */ -- 1.7.10.4