jstedfast / gmime

A C/C++ MIME creation and parser library with support for S/MIME, PGP, and Unix mbox spools.
GNU Lesser General Public License v2.1
113 stars 36 forks source link

How to get GMimeReferences from GMimeMessage? #92

Closed Jeevhi closed 4 years ago

Jeevhi commented 4 years ago

I am trying to get message ids from reference and in-reply-to field. I see that GMimeReferences is define but there is no function to get it from parsed message. Can you help.

Thanks

jstedfast commented 4 years ago

You need to use: GMimeReferences *g_mime_references_parse (GMimeParserOptions *options, const char *text);

GMimeReferences *references;
const char *value;

value = g_mime_object_get_header (GMIME_OBJECT (message), "References");
references = g_mime_references_parse (NULL, value);
Jeevhi commented 4 years ago

Thank you for quick response. Does GMimeReferences needs to be freed after use?

jstedfast commented 4 years ago

Yes.