diff options
author | Dan Winship <danw@src.gnome.org> | 2000-08-02 10:56:48 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2000-08-02 10:56:48 +0800 |
commit | 324b1e8675ed32dcdc051a2fd916158bd02a9893 (patch) | |
tree | 341c0f634e335e1deba13131ffaac4545f6c43e3 /mail/mail-display.c | |
parent | fad59bb3a344526f343b8e28a8d28059e81a42a9 (diff) | |
download | gsoc2013-evolution-324b1e8675ed32dcdc051a2fd916158bd02a9893.tar.gz gsoc2013-evolution-324b1e8675ed32dcdc051a2fd916158bd02a9893.tar.zst gsoc2013-evolution-324b1e8675ed32dcdc051a2fd916158bd02a9893.zip |
New code to spawn off GPG/PGP to do stuff. Currently only deals with
* mail-crypto.c: New code to spawn off GPG/PGP to do stuff.
Currently only deals with decryption. From Nathan Thompson-Amato
<ndt@jps.net>, with bunches of changes from me.
* session.c (mail_request_dialog): Expose the password dialog to
the rest of the app (for use by the GPG/PGP code).
* mail-format.c (handle_text_plain): Handle special inline data
types. (Currently uuencoding, BinHex, and PGP encryption.) This is
not the best way to deal with it, but it works for now.
(try_inline_pgp): Convert an inline PGP-encrypted message into a
multipart/encrypted part.
(try_inline_binhex): Convert an inline BinHex attachment into an
application/mac-binhex40 part (which we currently don't deal
with...)
(try_uudecoding): Convert a uuencoded attachment to an
application/octet-stream part.
(handle_multipart_encrypted): Deal with RFC2015 MIME-encoded PGP
encrypted messages. (From ndt.)
* mail-display.c (mail_text_write, mail_error_write): New utility
functions.
* Makefile.am (evolution_mail_SOURCES): add mail-crypto.c
svn path=/trunk/; revision=4466
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r-- | mail/mail-display.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c index a0f6acbbe0..3af2ec1b15 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -16,6 +16,7 @@ #include <gnome.h> #include "e-util/e-setup.h" #include "e-util/e-util.h" +#include "e-util/e-html-utils.h" #include "mail-display.h" #include "mail.h" @@ -355,6 +356,47 @@ mail_html_write (GtkHTML *html, GtkHTMLStream *stream, g_free (buf); } +void +mail_text_write (GtkHTML *html, GtkHTMLStream *stream, + const char *format, ...) +{ + char *buf, *htmltext; + va_list ap; + + va_start (ap, format); + buf = g_strdup_vprintf (format, ap); + va_end (ap); + + htmltext = e_text_to_html (buf, + E_TEXT_TO_HTML_CONVERT_URLS | + E_TEXT_TO_HTML_CONVERT_NL | + E_TEXT_TO_HTML_CONVERT_SPACES); + gtk_html_write (html, stream, "<tt>", 4); + gtk_html_write (html, stream, htmltext, strlen (htmltext)); + gtk_html_write (html, stream, "</tt>", 5); + g_free (htmltext); + g_free (buf); +} + +void +mail_error_write (GtkHTML *html, GtkHTMLStream *stream, + const char *format, ...) +{ + char *buf, *htmltext; + va_list ap; + + va_start (ap, format); + buf = g_strdup_vprintf (format, ap); + va_end (ap); + + htmltext = e_text_to_html (buf, E_TEXT_TO_HTML_CONVERT_NL); + gtk_html_write (html, stream, "<em><font color=red>", 20); + gtk_html_write (html, stream, htmltext, strlen (htmltext)); + gtk_html_write (html, stream, "</font></em><br>", 16); + g_free (htmltext); + g_free (buf); +} + /** * mail_display_set_message: |