aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-07-18 03:51:41 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-07-18 03:51:41 +0800
commitde5890b84b581099ab27937f9dd592f4658efdc0 (patch)
tree926671e7b2d4b86ed78ba6aecfeb57d942380070
parent2890d2c2a1ffdd60f0540b04d7e569c0d8b84127 (diff)
downloadgsoc2013-evolution-de5890b84b581099ab27937f9dd592f4658efdc0.tar
gsoc2013-evolution-de5890b84b581099ab27937f9dd592f4658efdc0.tar.gz
gsoc2013-evolution-de5890b84b581099ab27937f9dd592f4658efdc0.tar.bz2
gsoc2013-evolution-de5890b84b581099ab27937f9dd592f4658efdc0.tar.lz
gsoc2013-evolution-de5890b84b581099ab27937f9dd592f4658efdc0.tar.xz
gsoc2013-evolution-de5890b84b581099ab27937f9dd592f4658efdc0.tar.zst
gsoc2013-evolution-de5890b84b581099ab27937f9dd592f4658efdc0.zip
Cleaned up a bit. (handle_multipart_encrypted): Replace the encrypted part
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. svn path=/trunk/; revision=11166
-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);
}
}