From fcad059f762ddc8ec8ee190e6557ee7451edc8c6 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Sun, 13 Aug 2000 02:25:10 +0000 Subject: Redo this so that the lock icon remains active after a failed decryption * mail-format.c (decode_pgp): Redo this so that the lock icon remains active after a failed decryption so you can click on it and try again. (try_inline_pgp, handle_multipart_encrypted): Put a border around the decrypted data. svn path=/trunk/; revision=4790 --- mail/ChangeLog | 6 ++++++ mail/mail-format.c | 42 +++++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 17 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index b70bb51a84..2e4748581b 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,11 @@ 2000-08-12 Dan Winship + * mail-format.c (decode_pgp): Redo this so that the lock icon + remains active after a failed decryption so you can click on it + and try again. + (try_inline_pgp, handle_multipart_encrypted): Put a border around + the decrypted data. + * message-list.c (cleanup_regenerate_messagelist): Don't clear the tree here. If two "folder_changed"s arrive in close succession, then one possible ordering of events is diff --git a/mail/mail-format.c b/mail/mail-format.c index 05e08f05d1..36ce4d9b86 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -671,37 +671,37 @@ decode_pgp (const char *ciphertext, MailDisplay *md) camel_exception_init (&ex); #ifdef PGP_PROGRAM /* FIXME: multipart parts */ - if (!g_datalist_get_data (md->data, "show_pgp")) { - mail_html_write (md->html, md->stream, - "
" - "" - "" - "Click on the icon to decrypt this " - "message.
", - get_url_for_icon ("gnome-lockscreen.png", md)); - return NULL; - } else + if (g_datalist_get_data (md->data, "show_pgp")) { plaintext = mail_crypto_openpgp_decrypt (ciphertext, &ex); + if (plaintext) + return plaintext; + } #else camel_exception_set (&ex, CAMEL_EXCEPTION_SYSTEM, "No GPG/PGP support available in this copy " "of Evolution."); #endif + mail_html_write (md->html, md->stream, + "
" + "" + "", + get_url_for_icon ("gnome-lockscreen.png", md)); + if (camel_exception_is_set (&ex)) { mail_html_write (md->html, md->stream, - "
" - "
" - "
", - get_url_for_icon ("gnome-lockscreen.png", md)); + "Encrypted message not displayed

\n"); mail_error_write (md->html, md->stream, - "(Encrypted message not displayed)\n\n%s", camel_exception_get_description (&ex)); - mail_html_write (md->html, md->stream, "
"); camel_exception_clear (&ex); + } else { + mail_html_write (md->html, md->stream, + "Encrypted message

\n" + "Click icon to decrypt."); } - return plaintext; + mail_html_write (md->html, md->stream, "
"); + return NULL; } static char * @@ -723,7 +723,11 @@ try_inline_pgp (char *start, MailDisplay *md) plaintext = decode_pgp (ciphertext, md); g_free (ciphertext); if (plaintext) { + mail_html_write (md->html, md->stream, + "
"); mail_text_write (md->html, md->stream, "%s", plaintext); + mail_html_write (md->html, md->stream, "
"); g_free (plaintext); } @@ -1090,7 +1094,11 @@ handle_multipart_encrypted (CamelMimePart *part, const char *mime_type, memstream); camel_object_unref (CAMEL_OBJECT (memstream)); + mail_html_write (md->html, md->stream, + "
"); call_handler_function (part, md); + mail_html_write (md->html, md->stream, "
"); camel_object_hook_event (CAMEL_OBJECT (md->current_message), "finalize", destroy_part, part); g_free (plaintext); -- cgit v1.2.3