mirror of https://github.com/djcb/mu.git
* lib/: add support for getting mailing lists
This commit is contained in:
parent
edb73a742f
commit
d47a687a4d
|
@ -160,14 +160,6 @@ static const MuMsgField FIELD_DATA[] = {
|
|||
},
|
||||
|
||||
|
||||
{
|
||||
MU_MSG_FIELD_ID_LIST,
|
||||
MU_MSG_FIELD_TYPE_STRING,
|
||||
"list", 'v', 'L',
|
||||
FLAG_GMIME | FLAG_XAPIAN_VALUE
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
MU_MSG_FIELD_ID_MAILDIR,
|
||||
MU_MSG_FIELD_TYPE_STRING,
|
||||
|
@ -177,6 +169,14 @@ static const MuMsgField FIELD_DATA[] = {
|
|||
},
|
||||
|
||||
|
||||
{
|
||||
MU_MSG_FIELD_ID_MAILING_LIST,
|
||||
MU_MSG_FIELD_TYPE_STRING,
|
||||
"list", 'v', 'L',
|
||||
FLAG_GMIME | FLAG_XAPIAN_VALUE
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
MU_MSG_FIELD_ID_MIME,
|
||||
MU_MSG_FIELD_TYPE_STRING,
|
||||
|
|
|
@ -56,7 +56,7 @@ enum _MuMsgFieldId {
|
|||
MU_MSG_FIELD_ID_SIZE,
|
||||
|
||||
/* add new ones here... */
|
||||
MU_MSG_FIELD_ID_LIST, /* mailing list */
|
||||
MU_MSG_FIELD_ID_MAILING_LIST, /* mailing list */
|
||||
|
||||
|
||||
MU_MSG_FIELD_ID_NUM
|
||||
|
|
|
@ -618,7 +618,7 @@ mu_msg_file_get_str_field (MuMsgFile *self, MuMsgFieldId mfid,
|
|||
|
||||
case MU_MSG_FIELD_ID_PATH: return self->_path;
|
||||
|
||||
case MU_MSG_FIELD_ID_LIST:
|
||||
case MU_MSG_FIELD_ID_MAILING_LIST:
|
||||
*do_free = TRUE;
|
||||
return (char*)get_mailing_list (self);
|
||||
|
||||
|
|
10
lib/mu-msg.c
10
lib/mu-msg.c
|
@ -373,6 +373,16 @@ mu_msg_get_msgid (MuMsg *self)
|
|||
return get_str_field (self, MU_MSG_FIELD_ID_MSGID);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const char*
|
||||
mu_msg_get_mailing_list (MuMsg *self)
|
||||
{
|
||||
g_return_val_if_fail (self, NULL);
|
||||
return get_str_field (self, MU_MSG_FIELD_ID_MAILING_LIST);
|
||||
}
|
||||
|
||||
|
||||
const char*
|
||||
mu_msg_get_maildir (MuMsg *self)
|
||||
{
|
||||
|
|
15
lib/mu-msg.h
15
lib/mu-msg.h
|
@ -261,13 +261,26 @@ const char* mu_msg_get_subject (MuMsg *msg);
|
|||
*
|
||||
* @param msg a valid MuMsg* instance
|
||||
*
|
||||
* @return the Message-Id of this Message (without the enclosing <>)
|
||||
* @return the Message-Id of this message (without the enclosing <>)
|
||||
* or NULL in case of error or if there is none. the returned string
|
||||
* should *not* be modified or freed.
|
||||
*/
|
||||
const char* mu_msg_get_msgid (MuMsg *msg);
|
||||
|
||||
|
||||
/**
|
||||
* get the mailing list for a message, i.e. the mailing-list
|
||||
* identifier in the List-Id header.
|
||||
*
|
||||
* @param msg a valid MuMsg* instance
|
||||
*
|
||||
* @return the mailing list id for this message (without the enclosing <>)
|
||||
* or NULL in case of error or if there is none. the returned string
|
||||
* should *not* be modified or freed.
|
||||
*/
|
||||
const char* mu_msg_get_mailing_list (MuMsg *msg);
|
||||
|
||||
|
||||
/**
|
||||
* get any arbitrary header from this message
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue