X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=util%2Fgmime-extra.h;h=fef4f4252ed11a7a40445946edeffc81fdf931f0;hp=04d630260259094ee5e7e527a24b4417d3c86275;hb=32819f74d3ac2eee25cf234d988688cc82ecbc0a;hpb=cbb2d5608ef6dd54d6e9e19b2bb570d3fe54b28b diff --git a/util/gmime-extra.h b/util/gmime-extra.h index 04d63026..fef4f425 100644 --- a/util/gmime-extra.h +++ b/util/gmime-extra.h @@ -6,6 +6,26 @@ GMimeStream *g_mime_stream_stdout_new(void); #include + +#if (GMIME_MAJOR_VERSION < 3) + +#define GMIME_ADDRESS_TYPE_TO GMIME_RECIPIENT_TYPE_TO +#define GMIME_ADDRESS_TYPE_CC GMIME_RECIPIENT_TYPE_CC +#define GMIME_ADDRESS_TYPE_BCC GMIME_RECIPIENT_TYPE_BCC + + +#else /* GMime >= 3.0 */ +typedef GMimeAddressType GMimeRecipientType; +#endif + +/** + * Return the contents of the appropriate address header as a string + * Should be freed using g_free + */ +char *g_mime_message_get_address_string (GMimeMessage *message, GMimeRecipientType type); + +InternetAddressList * g_mime_message_get_addresses (GMimeMessage *message, GMimeRecipientType type); + /** * return talloc allocated date string */ @@ -30,6 +50,4 @@ InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message); * return talloc allocated reply-to string */ char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message); - - #endif