aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-utils.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-04-01 00:08:36 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-04-01 03:48:01 +0800
commit9ed9a99baddcb87eab366e4f939dc146f2db9401 (patch)
treeb4fb0824904a261fa671973d9a499ed4328c0689 /mail/em-utils.c
parentd15cd735886c38ac4c14faa816c307ce8f388844 (diff)
downloadgsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.gz
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.bz2
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.lz
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.xz
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.tar.zst
gsoc2013-evolution-9ed9a99baddcb87eab366e4f939dc146f2db9401.zip
EMFormat: Add "session" as a constructor property.
Pass it in instead of digging it out of EShellSettings.
Diffstat (limited to 'mail/em-utils.c')
-rw-r--r--mail/em-utils.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/mail/em-utils.c b/mail/em-utils.c
index a9b57125a2..52856865b9 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -646,12 +646,17 @@ em_utils_print_messages_to_file (CamelFolder *folder,
{
EMFormatHTMLDisplay *efhd;
CamelMimeMessage *message;
+ CamelStore *parent_store;
+ CamelSession *session;
message = camel_folder_get_message_sync (folder, uid, NULL, NULL);
if (message == NULL)
return FALSE;
- efhd = em_format_html_display_new ();
+ parent_store = camel_folder_get_parent_store (folder);
+ session = camel_service_get_session (CAMEL_SERVICE (parent_store));
+
+ efhd = em_format_html_display_new (session);
((EMFormat *) efhd)->message_uid = g_strdup (uid);
em_format_parse_async ((EMFormat *) efhd, message, folder, NULL,
@@ -1162,6 +1167,7 @@ em_utils_get_proxy (void)
/**
* em_utils_message_to_html:
+ * @session: a #CamelSession
* @message:
* @credits:
* @flags: EMFormatQuote flags
@@ -1177,7 +1183,8 @@ em_utils_get_proxy (void)
* Return value: The html version as a NULL terminated string.
**/
gchar *
-em_utils_message_to_html (CamelMimeMessage *message,
+em_utils_message_to_html (CamelSession *session,
+ CamelMimeMessage *message,
const gchar *credits,
guint32 flags,
EMFormat *source,
@@ -1188,11 +1195,13 @@ em_utils_message_to_html (CamelMimeMessage *message,
CamelStream *mem;
GByteArray *buf;
+ g_return_val_if_fail (CAMEL_IS_SESSION (session), NULL);
+
buf = g_byte_array_new ();
mem = camel_stream_mem_new ();
camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (mem), buf);
- emfq = em_format_quote_new (credits, mem, flags);
+ emfq = em_format_quote_new (session, credits, mem, flags);
em_format_set_composer ((EMFormat *) emfq, TRUE);
if (!source) {