Re: [evolution-patches] Fix address field display.
- From: Jeffrey Stedfast <fejj ximian com>
- To: David Woodhouse <dwmw2 infradead org>
- Cc: evolution-patches ximian com
- Subject: Re: [evolution-patches] Fix address field display.
- Date: Tue, 06 Jan 2004 14:02:45 -0500
No... can't do that. You want the addresses to be formatted "nicely"
by nicely I mean:
John "D." Grahame <jdg company com>
is not a pretty way to display it, but is one of the ways to encode the
name part of the name-addr. We want that displayed as:
John D. Grahame <jdg company com>
which is the way it would display currently.
but more importantly, we want to rfc2047 decode the names too.
this is the wrong way to go about fixing your issue.
Jeff
On Tue, 2004-01-06 at 17:50 +0000, David Woodhouse wrote:
> This simplifies the rendering of mail, and has the added benefit that we
> no longer lose information when displaying address headers. Observe the
> difference between
> http://www.infradead.org/~dwmw2/evo-losing-to.jpeg
> and http://www.infradead.org/~dwmw2/evo-showing-to.jpeg
>
> Generated with 'diff -w' for ease of reading; of course when I commit it
> the whitespace will be correct.
>
> Index: mail/ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
> retrieving revision 1.2973
> diff -u -p -w -r1.2973 ChangeLog
> -- mail/ChangeLog 6 Jan 2004 15:32:16 -0000 1.2973
> +++ mail/ChangeLog 6 Jan 2004 17:32:42 -0000
> @@ -1,3 +1,9 @@
> +2004-01-06 David Woodhouse <dwmw2 infradead org>
> +
> + * em-format-html.c (efh_format_header): Don't attempt to recreate
> + To:, Cc: and similar headers from the addresses which camel happens
> + to know about; display the real content of the mail instead.
> +
> 2004-01-06 Jeffrey Stedfast <fejj ximian com>
>
> * em-message-browser.c (emmb_set_message): Protect against a NULL
> Index: mail/em-format-html.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/em-format-html.c,v
> retrieving revision 1.20
> diff -u -p -w -r1.20 em-format-html.c
> -- mail/em-format-html.c 11 Dec 2003 23:47:32 -0000 1.20
> +++ mail/em-format-html.c 6 Jan 2004 17:32:42 -0000
> @@ -1407,43 +1407,18 @@ efh_format_text_header(EMFormat *emf, Ca
> }
>
> static void
> -efh_format_address(EMFormat *emf, CamelStream *stream, const CamelInternetAddress *cia, const char *name, guint32 flags)
> -{
> - char *text;
> -
> - if (cia == NULL || !camel_internet_address_get(cia, 0, NULL, NULL))
> - return;
> -
> - text = camel_address_format((CamelAddress *)cia);
> - efh_format_text_header(emf, stream, name, text, flags | EM_FORMAT_HEADER_BOLD);
> - g_free(text);
> -}
> -
> -static void
> efh_format_header(EMFormat *emf, CamelStream *stream, CamelMedium *part, const char *namein, guint32 flags, const char *charset)
> {
> #define msg ((CamelMimeMessage *)part)
> #define efh ((EMFormatHTML *)emf)
> char *name;
> + const char *txt, *label;
> + char *value = NULL;
>
> name = alloca(strlen(namein)+1);
> strcpy(name, namein);
> camel_strdown(name);
>
> - if (!strcmp(name, "from"))
> - efh_format_address(emf, stream, camel_mime_message_get_from(msg), _("From"), flags);
> - else if (!strcmp(name, "reply-to"))
> - efh_format_address(emf, stream, camel_mime_message_get_reply_to(msg), _("Reply-To"), flags);
> - else if (!strcmp(name, "to"))
> - efh_format_address(emf, stream, camel_mime_message_get_recipients(msg, CAMEL_RECIPIENT_TYPE_TO), _("To"), flags);
> - else if (!strcmp(name, "cc"))
> - efh_format_address(emf, stream, camel_mime_message_get_recipients(msg, CAMEL_RECIPIENT_TYPE_CC), _("Cc"), flags);
> - else if (!strcmp(name, "bcc"))
> - efh_format_address(emf, stream, camel_mime_message_get_recipients(msg, CAMEL_RECIPIENT_TYPE_BCC), _("Bcc"), flags);
> - else {
> - const char *txt, *label;
> - char *value = NULL;
> -
> if (!strcmp(name, "subject")) {
> txt = camel_mime_message_get_subject(msg);
> label = _("Subject");
> @@ -1502,12 +1477,29 @@ efh_format_header(EMFormat *emf, CamelSt
> txt = camel_medium_get_header(part, name);
> value = camel_header_decode_string (txt, charset);
> txt = value;
> +
> + /* Translate and make bold the common headers */
> + if (!strcmp(name, "from")) {
> + label = _("From");
> + flags |= EM_FORMAT_HEADER_BOLD;
> + } else if (!strcmp(name, "reply-to")) {
> + label = _("Reply-To");
> + flags |= EM_FORMAT_HEADER_BOLD;
> + } else if (!strcmp(name, "to")) {
> + label = _("To");
> + flags |= EM_FORMAT_HEADER_BOLD;
> + } else if (!strcmp(name, "cc")) {
> + label = _("Cc");
> + flags |= EM_FORMAT_HEADER_BOLD;
> + } else if (!strcmp(name, "bcc")) {
> + label = _("Bcc");
> + flags |= EM_FORMAT_HEADER_BOLD;
> + } else
> label = namein;
> }
>
> efh_format_text_header(emf, stream, label, txt, flags);
> g_free(value);
> - }
> #undef msg
> #undef efh
> }
>
> --
> dwmw2
>
> _______________________________________________
> Evolution-patches mailing list
> Evolution-patches lists ximian com
> http://lists.ximian.com/mailman/listinfo/evolution-patches
--
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com - www.ximian.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]