diff options
author | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-07-30 22:36:46 +0800 |
---|---|---|
committer | Chenthill Palanisamy <pchen@src.gnome.org> | 2007-07-30 22:36:46 +0800 |
commit | 442fe9209a578c60c755a369e796c6ff78eb2135 (patch) | |
tree | 4ed8ef78634359741969492148eb09204ce89c41 | |
parent | 5ae0eec31487c832f8c800d718bbd16aa83f3687 (diff) | |
download | gsoc2013-evolution-442fe9209a578c60c755a369e796c6ff78eb2135.tar.gz gsoc2013-evolution-442fe9209a578c60c755a369e796c6ff78eb2135.tar.zst gsoc2013-evolution-442fe9209a578c60c755a369e796c6ff78eb2135.zip |
Display a information string if a from and sender are different.
svn path=/trunk/; revision=33903
-rw-r--r-- | mail/ChangeLog | 7 | ||||
-rw-r--r-- | mail/em-format-html.c | 59 |
2 files changed, 65 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog index 2ba70b9dfa..5122d9d747 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,10 @@ +2007-07-30 Chenthill Palanisamy <pchenthill@novell.com> + + * em-format-html.c: (efh_format_headers): Displaying a message + to the recipient of the mail informing him about delegated mails. + The message is displayed for all mails containing the "Sender" field + Committing on behalf of Bharath Acharya <abharath@novell.com> + 2007-07-29 Rob Bradford <rob@robster.org.uk> ** Potential fix for: #453668 diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 3334e65ce3..325035490b 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1776,6 +1776,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) gboolean face_decoded = FALSE; char *face_header_value = NULL; int face_header_len = 0; + char *header_sender = NULL, *header_from = NULL, *name; ct = camel_mime_part_get_content_type((CamelMimePart *)part); charset = camel_content_type_param (ct, "charset"); @@ -1784,8 +1785,64 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) if (!efh->simple_headers) camel_stream_printf(stream, "<font color=\"#%06x\">\n" - "<table cellpadding=\"0\" width=\"100%%\"><tr><td><table cellpadding=\"0\">\n", + "<table cellpadding=\"0\" width=\"100%%\">", efh->text_colour & 0xffffff); + + + header = ((CamelMimePart *)part)->headers; + while (header) { + if(!g_ascii_strcasecmp (header->name, "Sender")) { + struct _camel_header_address *addrs; + GString *html; + + if (!(addrs = camel_header_address_decode(header->value, emf->charset ? emf->charset : emf->default_charset))) + return; + + html = g_string_new(""); + name = efh_format_address(efh, html, addrs, header->name); + + header_sender= html->str; + camel_header_address_unref(addrs); + + g_string_free(html, FALSE); + g_free (name); + } + + if(!g_ascii_strcasecmp (header->name, "From")) { + struct _camel_header_address *addrs; + GString *html; + + if (!(addrs = camel_header_address_decode(header->value, emf->charset ? emf->charset : emf->default_charset))) + return; + + html = g_string_new(""); + name = efh_format_address(efh, html, addrs, header->name); + + header_from= html->str; + camel_header_address_unref(addrs); + + g_string_free(html, FALSE); + g_free(name); + } + + if (header_sender && header_from) { + camel_stream_printf(stream, "<tr><td><table border=1 width=\"100%%\" cellspacing=2 cellpadding=2><tr>"); + camel_stream_printf(stream, "<td align=\"left\" width=\"100%%\">"); + /* To translators: This message suggests to the receipients that the sender of the mail is + different from the one listed in From field. + */ + camel_stream_printf(stream, "This message was sent by <b>%s</b> on behalf of <b>%s</b>", header_sender, header_from); + camel_stream_printf(stream, "</td></tr></table></td></tr>"); + break; + } + + header = header->next; + } + + g_free (header_sender); + g_free (header_from); + + camel_stream_printf(stream, "<tr><td><table border=0 cellpadding=\"0\">\n"); /* dump selected headers */ h = (EMFormatHeader *)emf->header_list.head; |