");
if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL)
g_string_append (
buffer, "");
else
g_string_append (
buffer, " | ");
bold_sender = g_strconcat ("", header_sender, "", NULL);
bold_from = g_strconcat ("", header_from, "", NULL);
/* Translators: This message suggests to the receipients
* that the sender of the mail is different from the one
* listed in From field. */
g_string_append_printf (
buffer,
_("This message was sent by %s on behalf of %s"),
bold_sender, bold_from);
g_string_append (buffer, " |
|
");
g_free (bold_sender);
g_free (bold_from);
}
g_free (header_sender);
g_free (header_from);
g_string_append (
buffer,
""
"\n");
g_free (evolution_imagesdir);
/* dump selected headers */
if (mode & E_MAIL_FORMATTER_MODE_ALL_HEADERS) {
header = ((CamelMimePart *) part)->headers;
while (header) {
e_mail_formatter_format_header (
formatter, buffer, part, header,
E_MAIL_FORMATTER_HEADER_FLAG_NOCOLUMNS, charset);
header = header->next;
}
} else {
GQueue *headers_queue;
GList *link;
gint mailer_shown = FALSE;
headers_queue = e_mail_formatter_dup_headers (formatter);
link = g_queue_peek_head_link (headers_queue);
while (link != NULL) {
EMailFormatterHeader *h = link->data;
gint mailer, face;
header = ((CamelMimePart *) part)->headers;
mailer = !g_ascii_strcasecmp (h->name, "X-Evolution-Mailer");
face = !g_ascii_strcasecmp (h->name, "Face");
while (header) {
if (e_mail_formatter_get_show_sender_photo (formatter) &&
!photo_name && !g_ascii_strcasecmp (header->name, "From"))
photo_name = header->value;
if (!mailer_shown && mailer && (
!g_ascii_strcasecmp (header->name, "X-Mailer") ||
!g_ascii_strcasecmp (header->name, "User-Agent") ||
!g_ascii_strcasecmp (header->name, "X-Newsreader") ||
!g_ascii_strcasecmp (header->name, "X-MimeOLE"))) {
struct _camel_header_raw xmailer, *use_header = NULL;
if (!g_ascii_strcasecmp (header->name, "X-MimeOLE")) {
for (use_header = header->next; use_header; use_header = use_header->next) {
if (!g_ascii_strcasecmp (use_header->name, "X-Mailer") ||
!g_ascii_strcasecmp (use_header->name, "User-Agent") ||
!g_ascii_strcasecmp (use_header->name, "X-Newsreader")) {
/* even we have X-MimeOLE, then use rather the standard one, when available */
break;
}
}
}
if (!use_header)
use_header = header;
xmailer.name = (gchar *) "X-Evolution-Mailer";
xmailer.value = use_header->value;
mailer_shown = TRUE;
e_mail_formatter_format_header (
formatter, buffer, part,
&xmailer, h->flags, charset);
if (strstr (use_header->value, "Evolution"))
have_icon = TRUE;
} else if (!face_decoded && face && !g_ascii_strcasecmp (header->name, "Face")) {
gchar *cp = header->value;
/* Skip over spaces */
while (*cp == ' ')
cp++;
face_header_value = g_base64_decode (
cp, &face_header_len);
face_header_value = g_realloc (
face_header_value,
face_header_len + 1);
face_header_value[face_header_len] = 0;
face_decoded = TRUE;
/* Showing an encoded "Face" header makes little sense */
} else if (!g_ascii_strcasecmp (header->name, h->name) && !face) {
e_mail_formatter_format_header (
formatter, buffer, part,
header, h->flags, charset);
}
header = header->next;
}
link = g_list_next (link);
}
g_queue_free_full (headers_queue, (GDestroyNotify) e_mail_formatter_header_free);
}
g_string_append (buffer, " | ");
if (photo_name) {
gchar *name;
name = g_uri_escape_string (photo_name, NULL, FALSE);
g_string_append (buffer, "");
g_string_append_printf (
buffer,
"",
name);
g_string_append (buffer, " | ");
g_free (name);
}
if (!contact_has_photo && face_decoded) {
CamelMimePart *part;
part = camel_mime_part_new ();
camel_mime_part_set_content (
(CamelMimePart *) part,
(const gchar *) face_header_value,
face_header_len, "image/png");
g_string_append (buffer, "");
write_contact_picture (part, 48, buffer);
g_string_append (buffer, " | ");
g_object_unref (part);
g_free (face_header_value);
}
if (have_icon) {
GtkIconInfo *icon_info;
CamelMimePart *iconpart = NULL;
icon_info = gtk_icon_theme_lookup_icon (
gtk_icon_theme_get_default (),
"evolution", 16, GTK_ICON_LOOKUP_NO_SVG);
if (icon_info != NULL) {
iconpart = load_picture_from_file (
"image/png", gtk_icon_info_get_filename (icon_info),
cancellable);
gtk_icon_info_free (icon_info);
}
if (iconpart) {
g_string_append (buffer, "");
write_contact_picture (iconpart, 16, buffer);
g_string_append (buffer, " | ");
g_object_unref (iconpart);
}
}
g_string_append (buffer, "