commit ecfabc2b85e6f38bd797f8c1a9288e959ce6f81d Author: Patrick McManus Date: Wed Feb 13 18:14:19 2008 -0500 The "Show the photograph of sender in the email preview" option only applied to photos stored in the addressbook - not to the Face header functionality. This patch normalizes the behavior of that option - they are both shown, or both suppressed. Combined patch of that along with the one from http://bugzilla.gnome.org/show_bug.cgi?id=481235 That patch fixes a bug where Faces would be suppressed if the option were on, but there was no picture in the addressbook. patch based on 2.12.1 sources from ubuntu 7.10 diff --git a/mail/em-format-html.c b/mail/em-format-html.c index b8e96ae..f213767 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; char *face_header_value = NULL; int face_header_len = 0; char *header_sender = NULL, *header_from = NULL, *name; @@ -1895,7 +1895,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) efh_format_header (emf, stream, part, &xmailer, h->flags, charset); if (strstr(header->value, "Evolution")) have_icon = TRUE; - } else if (!g_ascii_strcasecmp (header->name, "Face") && !face_decoded) { + } else if (!g_ascii_strcasecmp (header->name, "Face") && !face_decoded && emf->show_photo) { char *tmp; face_decoded = TRUE; @@ -1929,6 +1929,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, @@ -1937,11 +1938,12 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) em_format_add_puri(emf, sizeof(EMFormatPURI), classid, photopart, efh_write_image); camel_object_unref(photopart); - + g_free(classid); } camel_object_unref(cia); - } else if (face_decoded) { + } + if (!contact_has_photo && face_decoded) { char *classid; CamelMimePart *part;