{
GMimeMessage *mime_message;
InternetAddressList *addresses;
- const char *from, *subject;
+ const char *subject;
notmuch_status_t status;
status = _notmuch_message_file_get_mime_message (message_file,
if (status)
return status;
- from = g_mime_message_get_sender (mime_message);
-
- addresses = internet_address_list_parse_string (from);
+ addresses = g_mime_message_get_from (mime_message);
if (addresses) {
_index_address_list (message, "from", addresses);
g_object_unref (addresses);
#include <talloc.h>
-#include <gmime/gmime.h>
+#include "gmime-extra.h"
#include "xutil.h"
#include "error_util.h"
InternetAddressList *recipients;
char *recipients_string;
- g_mime_stream_printf (stream, "> From: %s\n", g_mime_message_get_sender (message));
recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);
recipients_string = internet_address_list_to_string (recipients, 0);
+ g_mime_stream_printf (stream, "> From: %s\n", g_mime_message_get_from_string (message));
if (recipients_string)
g_mime_stream_printf (stream, "> To: %s\n",
recipients_string);
g_object_unref (G_OBJECT (reply_to_list));
}
- return internet_address_list_parse_string (
- g_mime_message_get_sender (message));
+ return g_mime_message_get_from (message);
}
static InternetAddressList *get_to(GMimeMessage *message)
sp->string (sp, g_mime_message_get_subject (message));
sp->map_key (sp, "From");
- sp->string (sp, g_mime_message_get_sender (message));
+ sp->string (sp, g_mime_message_get_from_string (message));
recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);
recipients_string = internet_address_list_to_string (recipients, 0);
if (node->envelope_file)
g_mime_stream_printf (stream, "%s\n", _get_one_line_summary (ctx, node->envelope_file));
g_mime_stream_printf (stream, "Subject: %s\n", g_mime_message_get_subject (message));
- g_mime_stream_printf (stream, "From: %s\n", g_mime_message_get_sender (message));
recipients = g_mime_message_get_recipients (message, GMIME_RECIPIENT_TYPE_TO);
recipients_string = internet_address_list_to_string (recipients, 0);
+ g_mime_stream_printf (stream, "From: %s\n", g_mime_message_get_from_string (message));
if (recipients_string)
g_mime_stream_printf (stream, "To: %s\n", recipients_string);
g_free (recipients_string);
return g_string_talloc_strdup (ctx, date);
}
+InternetAddressList *
+g_mime_message_get_from (GMimeMessage *message)
+{
+ return internet_address_list_parse_string (g_mime_message_get_sender (message));
+}
+
+const char *
+g_mime_message_get_from_string (GMimeMessage *message) {
+ return g_mime_message_get_sender (message);
+}
+
InternetAddressList *
g_mime_message_get_reply_to_list (GMimeMessage *message)
{
return g_mime_message_get_reply_to (message);
}
+const char *
+g_mime_message_get_from_string (GMimeMessage *message)
+{
+ return g_mime_object_get_header (GMIME_OBJECT (message), "From");
+}
+
char *
g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message)
{
/**
* return talloc allocated date string
*/
+
char *g_mime_message_get_date_string (void *ctx, GMimeMessage *message);
-InternetAddressList * g_mime_message_get_reply_to_list (GMimeMessage *message);
/**
- * return talloc allocated reply-to string
+ * glib allocated list of From: addresses
*/
-char * g_mime_message_get_reply_to_string (void *ctx, GMimeMessage *message);
+InternetAddressList * g_mime_message_get_from (GMimeMessage *message);
/**
- * Return glib allocated reply-to list
+ * return string for From: address
+ * (owned by gmime)
*/
+const char * g_mime_message_get_from_string (GMimeMessage *message);
+
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