diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-05-09 03:18:30 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-05-09 03:18:30 +0800 |
commit | 2bb791349c3eb9d7190816c4b38cab3d9efffc44 (patch) | |
tree | ef060c28c1882ff08ffd4417e2cb7e3c21e755db /mail/mail-tools.c | |
parent | 1a0cddf01be352b29b576214f17ceb5d9ef20c21 (diff) | |
download | gsoc2013-evolution-2bb791349c3eb9d7190816c4b38cab3d9efffc44.tar gsoc2013-evolution-2bb791349c3eb9d7190816c4b38cab3d9efffc44.tar.gz gsoc2013-evolution-2bb791349c3eb9d7190816c4b38cab3d9efffc44.tar.bz2 gsoc2013-evolution-2bb791349c3eb9d7190816c4b38cab3d9efffc44.tar.lz gsoc2013-evolution-2bb791349c3eb9d7190816c4b38cab3d9efffc44.tar.xz gsoc2013-evolution-2bb791349c3eb9d7190816c4b38cab3d9efffc44.tar.zst gsoc2013-evolution-2bb791349c3eb9d7190816c4b38cab3d9efffc44.zip |
Convert the Subject header to HTML and also make sure that the Subject,
2001-05-08 Jeffrey Stedfast <fejj@ximian.com>
* 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
Diffstat (limited to 'mail/mail-tools.c')
-rw-r--r-- | mail/mail-tools.c | 25 |
1 files changed, 17 insertions, 8 deletions
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-----<br>" "<b>From:</b> %s<br>" "<b>To:</b> %s<br>" "<b>Subject:</b> %s<br>"), - from, to, subject); + from ? from : "", to ? to : "", subject); g_free (from); g_free (to); |