aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-08-19 13:38:22 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-08-19 13:38:22 +0800
commit64c94ae9ce11ad1c94c0361244b468df8f758745 (patch)
tree2cce9155c795dac503cb160487432a158af48936 /mail/em-format-html-display.c
parentcb37c563afea6d1f7680fa845076992c749ee024 (diff)
downloadgsoc2013-evolution-64c94ae9ce11ad1c94c0361244b468df8f758745.tar.gz
gsoc2013-evolution-64c94ae9ce11ad1c94c0361244b468df8f758745.tar.zst
gsoc2013-evolution-64c94ae9ce11ad1c94c0361244b468df8f758745.zip
put the s/mime message back, awaiting string approval for a change
2005-08-19 Not Zed <NotZed@Ximian.com> * em-format.c (emf_multipart_encrypted): put the s/mime message back, awaiting string approval for a change otherwise. 2005-08-18 Not Zed <NotZed@Ximian.com> * em-format-html-display.c (efhd_message_add_bar): dont add attachment bar if it is disabled. (efhd_attachment_button): dont add attachments if there is no bar. * em-format.c (emf_inlinepgp_signed, emf_inlinepgp_encrypted): fix the error messages for consistency. We dont need to check content-type, since we only get called with the right one. (emf_multipart_encrypted): fix up wrong s/mime error. * em-format-html.c (efh_inlinepgp_signed) (efh_inlinepgp_encrypted): moved to em-format.c; otherwise this will break replying, etc. ** See #271894. * em-format.c (emf_multipart_encrypted): use the content object's content-type to check types. svn path=/trunk/; revision=30161
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c68
1 files changed, 36 insertions, 32 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 973f771ca0..c9340f3aa2 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -276,6 +276,8 @@ efhd_init(GObject *o)
efh->text_html_flags |= CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS | CAMEL_MIME_FILTER_TOHTML_CONVERT_ADDRESSES;
#undef efh
+ efhd->nobar = getenv("EVOLUTION_NO_BAR") != NULL;
+
efhd->priv->show_bar = FALSE;
efhd->priv->files = NULL;
}
@@ -1431,45 +1433,47 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje
g_assert(info != NULL);
g_assert(info->forward == NULL);
- file = camel_mime_part_get_filename(info->puri.part);
+ if (efhd->priv->attachment_bar) {
+ file = camel_mime_part_get_filename(info->puri.part);
- new = e_attachment_new_from_mime_part (info->puri.part);
+ new = e_attachment_new_from_mime_part (info->puri.part);
- if (!file) {
- file = "attachment.dat";
- new->file_name = g_strdup(file);
- }
+ if (!file) {
+ file = "attachment.dat";
+ new->file_name = g_strdup(file);
+ }
- tmp = g_hash_table_lookup (efhd->priv->files, file);
- if (tmp) {
- guint count = GPOINTER_TO_UINT(tmp);
- char *ext;
- char *tmp_file = g_strdup (file);
+ tmp = g_hash_table_lookup (efhd->priv->files, file);
+ if (tmp) {
+ guint count = GPOINTER_TO_UINT(tmp);
+ char *ext;
+ char *tmp_file = g_strdup (file);
- if ((ext = strrchr(tmp_file, '.'))) {
- ext[0] = 0;
- new_file = g_strdup_printf("%s(%d).%s", tmp_file, count++, ext+1);
+ if ((ext = strrchr(tmp_file, '.'))) {
+ ext[0] = 0;
+ new_file = g_strdup_printf("%s(%d).%s", tmp_file, count++, ext+1);
+ } else {
+ new_file = g_strdup_printf("%s(%d)", tmp_file, count++);
+ }
+
+ g_free (tmp_file);
+ g_hash_table_insert (efhd->priv->files, g_strdup(file), GUINT_TO_POINTER(count));
+ g_free (new->file_name);
+ new->file_name = new_file;
} else {
- new_file = g_strdup_printf("%s(%d)", tmp_file, count++);
+ g_hash_table_insert (efhd->priv->files, g_strdup(file), GUINT_TO_POINTER(1));
}
- g_free (tmp_file);
- g_hash_table_insert (efhd->priv->files, g_strdup(file), GUINT_TO_POINTER(count));
- g_free (new->file_name);
- new->file_name = new_file;
- } else {
- g_hash_table_insert (efhd->priv->files, g_strdup(file), GUINT_TO_POINTER(1));
- }
-
- /* Store the status of encryption / signature on the attachment for emblem display
- * FIXME: May not work well always
- */
- new->sign = info->sign;
- new->encrypt = info->encrypt;
+ /* Store the status of encryption / signature on the attachment for emblem display
+ * FIXME: May not work well always
+ */
+ new->sign = info->sign;
+ new->encrypt = info->encrypt;
- /* Add the attachment to the bar.*/
- e_attachment_bar_add_attachment (E_ATTACHMENT_BAR(efhd->priv->attachment_bar), new);
- efhd_attachment_bar_refresh (efhd);
+ /* Add the attachment to the bar.*/
+ e_attachment_bar_add_attachment(E_ATTACHMENT_BAR(efhd->priv->attachment_bar), new);
+ efhd_attachment_bar_refresh(efhd);
+ }
mainbox = gtk_hbox_new(FALSE, 0);
@@ -1984,7 +1988,7 @@ efhd_message_add_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, co
EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *) emf;
const char *classid = "attachment-bar";
- if (efhd->priv->files)
+ if (efhd->nobar || efhd->priv->files)
return;
efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);