Add authors member to message

message->authors contains the author's name (as we want to print it)
get / set methods are declared in notmuch-private.h

Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
This commit is contained in:
Dirk Hohndel 2010-04-24 11:20:53 -07:00 committed by Carl Worth
parent b66ff567f6
commit 57561414d7
2 changed files with 28 additions and 0 deletions

View file

@ -35,6 +35,7 @@ struct _notmuch_message {
char *thread_id; char *thread_id;
char *in_reply_to; char *in_reply_to;
char *filename; char *filename;
char *author;
notmuch_message_file_t *message_file; notmuch_message_file_t *message_file;
notmuch_message_list_t *replies; notmuch_message_list_t *replies;
unsigned long flags; unsigned long flags;
@ -110,6 +111,7 @@ _notmuch_message_create (const void *talloc_owner,
message->in_reply_to = NULL; message->in_reply_to = NULL;
message->filename = NULL; message->filename = NULL;
message->message_file = NULL; message->message_file = NULL;
message->author = NULL;
message->replies = _notmuch_message_list_create (message); message->replies = _notmuch_message_list_create (message);
if (unlikely (message->replies == NULL)) { if (unlikely (message->replies == NULL)) {
@ -533,6 +535,22 @@ notmuch_message_get_tags (notmuch_message_t *message)
return _notmuch_convert_tags(message, i, end); return _notmuch_convert_tags(message, i, end);
} }
const char *
notmuch_message_get_author (notmuch_message_t *message)
{
return message->author;
}
void
notmuch_message_set_author (notmuch_message_t *message,
const char *author)
{
if (message->author)
talloc_free(message->author);
message->author = talloc_strdup(message, author);
return;
}
void void
_notmuch_message_set_date (notmuch_message_t *message, _notmuch_message_set_date (notmuch_message_t *message,
const char *date) const char *date)

View file

@ -275,6 +275,16 @@ _notmuch_message_talloc_copy_data (notmuch_message_t *message);
void void
_notmuch_message_clear_data (notmuch_message_t *message); _notmuch_message_clear_data (notmuch_message_t *message);
/* Set the author member of 'message' - this is the representation used
* when displaying the message */
void
notmuch_message_set_author (notmuch_message_t *message, const char *author);
/* Get the author member of 'message' */
const char *
notmuch_message_get_author (notmuch_message_t *message);
/* index.cc */ /* index.cc */
notmuch_status_t notmuch_status_t