aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-display.c4
-rw-r--r--mail/mail-format.c35
3 files changed, 26 insertions, 19 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 5e5704bd25..1dd9b61909 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-17 Jeffrey Stedfast <fejj@ximian.com>
+
+ * mail-format.c (mail_part_toggle_displayed): Cleaned up a bit.
+ (handle_multipart_encrypted): Replace the encrypted part with the
+ decrypted part.
+
2001-07-17 Iain Holmes <iain@ximian.com>
* mail-accounts.c (mail_delete): Make a nicer dialog.
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 2a0748eb39..53251430d1 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -1197,14 +1197,14 @@ mail_display_redisplay (MailDisplay *md, gboolean unscroll)
mail_html_write (md->html, md->stream, "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n");
mail_html_write (md->html, md->stream, "<body marginwidth=0 marginheight=0>\n");
-
+
if (md->current_message) {
if (md->display_style == MAIL_CONFIG_DISPLAY_SOURCE)
mail_format_raw_message (md->current_message, md);
else
mail_format_mime_message (md->current_message, md);
}
-
+
mail_html_write (md->html, md->stream, "</body></html>\n");
gtk_html_end (md->html, md->stream, GTK_HTML_STREAM_OK);
md->stream = NULL;
diff --git a/mail/mail-format.c b/mail/mail-format.c
index cfe68fb559..b5d28eafca 100644
--- a/mail/mail-format.c
+++ b/mail/mail-format.c
@@ -561,23 +561,22 @@ void
mail_part_toggle_displayed (CamelMimePart *part, MailDisplay *md)
{
GHashTable *asht = g_datalist_get_data (md->data, "attachment_states");
+ gpointer ostate, opart;
gint state;
- state = GPOINTER_TO_INT (g_hash_table_lookup (asht, part));
-
- if (state & I_DISPLAYED) {
- /*printf ("** part %p, hiding\n", part);*/
- state &= ~I_DISPLAYED;
+ if (g_hash_table_lookup_extended (asht, part, &opart, &ostate)) {
+ g_hash_table_remove (asht, part);
+
+ state = GPOINTER_TO_INT (ostate);
+
+ if (state & I_DISPLAYED)
+ state &= ~I_DISPLAYED;
+ else
+ state |= I_DISPLAYED;
} else {
- if (state == 0) {
- /*printf ("** part %p: uninitialized attachment state! Showing.", part);*/
- state |= I_VALID;
- }
-
- printf ("** part %p, showing\n", part);
- state |= I_DISPLAYED;
+ state = I_VALID | I_DISPLAYED;
}
-
+
g_hash_table_insert (asht, part, GINT_TO_POINTER (state));
}
@@ -1658,12 +1657,14 @@ handle_multipart_encrypted (CamelMimePart *part, const char *mime_type,
camel_exception_clear (&ex);
return handle_multipart_mixed (part, mime_type, md);
} else {
- gboolean retcode;
-
- retcode = format_mime_part (mime_part, md);
+ /* replace the encrypted part with the decrypted part */
+ /* FIXME: will this cause problems anywhere? -- seems to work okay so far */
+ camel_medium_set_content_object (CAMEL_MEDIUM (part),
+ camel_medium_get_content_object (CAMEL_MEDIUM (mime_part)));
camel_object_unref (CAMEL_OBJECT (mime_part));
- return retcode;
+ /* and continue on our merry way... */
+ return format_mime_part (part, md);
}
}