From 528f6d679cd444a8f71b031d3de5a7ad31ed3b5b Mon Sep 17 00:00:00 2001 From: Sankar P Date: Mon, 1 Oct 2007 04:53:06 +0000 Subject: Display Face header value if contacts doesn't have any image associated 2007-10-01 Sankar P * em-format-html.c: (efh_format_headers): Display Face header value if contacts doesn't have any image associated with them. Fixes bug mentioned in #481235 and not the enhnacement request. svn path=/trunk/; revision=34333 --- mail/ChangeLog | 8 ++++++++ mail/em-format-html.c | 8 +++++--- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 2cad686331..d4c9202544 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2007-10-01 Sankar P + + * em-format-html.c: (efh_format_headers): + Display Face header value if contacts doesn't + have any image associated with them. + Fixes bug mentioned in #481235 and not the + enhnacement request. + 2007-09-27 Matthew Barnes * em-account-editor.c: diff --git a/mail/em-format-html.c b/mail/em-format-html.c index eb2ae95c3d..b1961bd2b2 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1785,7 +1785,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) gboolean have_icon = FALSE; const char *photo_name = NULL; CamelInternetAddress *cia = NULL; - gboolean face_decoded = FALSE; + gboolean face_decoded = FALSE, contact_has_photo = FALSE; guchar *face_header_value = NULL; gsize face_header_len = 0; char *header_sender = NULL, *header_from = NULL, *name; @@ -1927,6 +1927,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) photopart = em_utils_contact_photo (cia, emf->photo_local); if (photopart) { + contact_has_photo = TRUE; classid = g_strdup_printf("icon:///em-format-html/%s/photo/header", emf->part_id->str); camel_stream_printf(stream, @@ -1939,7 +1940,9 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) g_free(classid); } camel_object_unref(cia); - } else if (face_decoded) { + } + + if (!contact_has_photo && face_decoded) { char *classid; CamelMimePart *part; @@ -1949,7 +1952,6 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) camel_stream_printf(stream, "", classid); em_format_add_puri(emf, sizeof(EMFormatPURI), classid, part, efh_write_image); camel_object_unref(part); - } if (have_icon && efh->show_icon) { -- cgit v1.2.3