From 2bb791349c3eb9d7190816c4b38cab3d9efffc44 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 8 May 2001 19:18:30 +0000 Subject: Convert the Subject header to HTML and also make sure that the Subject, 2001-05-08 Jeffrey Stedfast * mail-tools.c (mail_tool_forward_message): Convert the Subject header to HTML and also make sure that the Subject, To, and From header values are non-NULL before feeding them into e_text_to_html(). svn path=/trunk/; revision=9718 --- mail/ChangeLog | 5 +++++ mail/mail-tools.c | 25 +++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index c742349f96..16307a3e04 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,10 @@ 2001-05-08 Jeffrey Stedfast + * mail-tools.c (mail_tool_forward_message): Convert the Subject + header to HTML and also make sure that the Subject, To, and From + header values are non-NULL before feeding them into + e_text_to_html(). + * mail-callbacks.c (edit_msg_internal): Free the UIDs if the user decides to not go through with editing all the messages he selected. diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 97433457a0..994879953b 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -396,27 +396,36 @@ mail_tool_forward_message (CamelMimeMessage *message) if (text) { gchar *ret_text, *credits = NULL; const CamelInternetAddress *cia; - const char *subject; - char *buf, *from, *to; + char *buf, *from, *to, *subject; /* create credits */ cia = camel_mime_message_get_from (message); buf = camel_address_format (CAMEL_ADDRESS (cia)); - from = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); - g_free (buf); + if (buf) { + from = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + g_free (buf); + } else + from = NULL; cia = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); buf = camel_address_format (CAMEL_ADDRESS (cia)); - to = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); - g_free (buf); + if (buf) { + to = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + g_free (buf); + } else + to = NULL; - subject = camel_mime_message_get_subject (message); + buf = (char *) camel_mime_message_get_subject (message); + if (buf) + subject = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL | E_TEXT_TO_HTML_CONVERT_URLS); + else + subject = ""; credits = g_strdup_printf (_("-----Forwarded Message-----
" "From: %s
" "To: %s
" "Subject: %s
"), - from, to, subject); + from ? from : "", to ? to : "", subject); g_free (from); g_free (to); -- cgit