]> git.cworth.org Git - notmuch/blobdiff - notmuch-show.c
lib/cli: replace use of g_mime_message_get_sender
[notmuch] / notmuch-show.c
index 084b7dab78e59423a03137ad57bf18b6a68835e1..1a72d12f68cab3980b4273d8de8b917b39c9dbc4 100644 (file)
@@ -204,7 +204,7 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,
     InternetAddressList *recipients;
     char *recipients_string;
     const char *reply_to_string;
-    char *date_string;
+    void *local = talloc_new (sp);
 
     sp->begin_map (sp);
 
@@ -212,7 +212,7 @@ format_headers_sprinter (sprinter_t *sp, 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);
@@ -238,7 +238,7 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,
        g_free (recipients_string);
     }
 
-    reply_to_string = g_mime_message_get_reply_to (message);
+    reply_to_string = g_mime_message_get_reply_to_string (local, message);
     if (reply_to_string) {
        sp->map_key (sp, "Reply-To");
        sp->string (sp, reply_to_string);
@@ -252,12 +252,11 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message,
        sp->string (sp, g_mime_object_get_header (GMIME_OBJECT (message), "References"));
     } else {
        sp->map_key (sp, "Date");
-       date_string = g_mime_message_get_date_as_string (message);
-       sp->string (sp, date_string);
-       g_free (date_string);
+       sp->string (sp, g_mime_message_get_date_string (sp, message));
     }
 
     sp->end (sp);
+    talloc_free (local);
 }
 
 /* Write a MIME text part out to the given stream.
@@ -521,9 +520,9 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,
        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);
@@ -532,9 +531,8 @@ format_part_text (const void *ctx, sprinter_t *sp, mime_node_t *node,
        if (recipients_string)
            g_mime_stream_printf (stream, "Cc: %s\n", recipients_string);
        g_free (recipients_string);
-       date_string = g_mime_message_get_date_as_string (message);
+       date_string = g_mime_message_get_date_string (node, message);
        g_mime_stream_printf (stream, "Date: %s\n", date_string);
-       g_free (date_string);
        g_mime_stream_printf (stream, "\fheader}\n");
 
        g_mime_stream_printf (stream, "\fbody{\n");