aboutsummaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-08-15 06:20:48 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-08-15 23:44:29 +0800
commitcbf51737faf61d88c3b7c5349b5db635b892c2c1 (patch)
tree0bc436489470b182a045e34679dab07bdf97f08f /modules
parent3aa74ebe41c3d30c0e22dabd2c27c215a90d0c73 (diff)
downloadgsoc2013-evolution-cbf51737faf61d88c3b7c5349b5db635b892c2c1.tar
gsoc2013-evolution-cbf51737faf61d88c3b7c5349b5db635b892c2c1.tar.gz
gsoc2013-evolution-cbf51737faf61d88c3b7c5349b5db635b892c2c1.tar.bz2
gsoc2013-evolution-cbf51737faf61d88c3b7c5349b5db635b892c2c1.tar.lz
gsoc2013-evolution-cbf51737faf61d88c3b7c5349b5db635b892c2c1.tar.xz
gsoc2013-evolution-cbf51737faf61d88c3b7c5349b5db635b892c2c1.tar.zst
gsoc2013-evolution-cbf51737faf61d88c3b7c5349b5db635b892c2c1.zip
Add e_mail_session_append_to_local_folder().
Asynchronous + synchronous convenience functions. Uses the EMailLocalFolder enumeration to specify a well-known folder.
Diffstat (limited to 'modules')
-rw-r--r--modules/mdn/evolution-mdn.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/modules/mdn/evolution-mdn.c b/modules/mdn/evolution-mdn.c
index cd6d3edac7..03abc00d24 100644
--- a/modules/mdn/evolution-mdn.c
+++ b/modules/mdn/evolution-mdn.c
@@ -24,8 +24,7 @@
#include <libevolution-utils/e-alert-dialog.h>
-#include <libemail-engine/e-mail-folder-utils.h>
-#include <libemail-engine/e-mail-session.h>
+#include <libemail-engine/e-mail-session-utils.h>
#include <mail/em-utils.h>
#include <mail/e-mail-reader.h>
@@ -187,15 +186,22 @@ mdn_get_disposition (MdnActionMode action_mode,
}
static void
-mdn_receipt_done (CamelFolder *folder,
+mdn_receipt_done (EMailSession *session,
GAsyncResult *result,
- EMailSession *session)
+ gpointer user_data)
{
- /* FIXME Poor error handling. */
- if (e_mail_folder_append_message_finish (folder, result, NULL, NULL))
- mail_send (session);
+ GError *error = NULL;
+
+ e_mail_session_append_to_local_folder_finish (
+ session, result, NULL, &error);
- g_object_unref (session);
+ if (error == NULL) {
+ mail_send (session);
+ } else {
+ /* FIXME Poor error handling. */
+ g_warning ("%s: %s", G_STRFUNC, error->message);
+ g_error_free (error);
+ }
}
static void
@@ -218,7 +224,6 @@ mdn_notify_sender (ESource *source,
CamelContentType *type;
CamelInternetAddress *address;
CamelStream *stream;
- CamelFolder *out_folder;
CamelMessageInfo *receipt_info;
EMailBackend *backend;
EMailSession *session;
@@ -420,15 +425,13 @@ mdn_notify_sender (ESource *source,
/* Send the receipt. */
receipt_info = camel_message_info_new (NULL);
- out_folder =
- e_mail_session_get_local_folder (
- session, E_MAIL_LOCAL_FOLDER_OUTBOX);
camel_message_info_set_flags (
receipt_info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
/* FIXME Pass a GCancellable. */
- e_mail_folder_append_message (
- out_folder, receipt, receipt_info, G_PRIORITY_DEFAULT,
+ e_mail_session_append_to_local_folder (
+ session, E_MAIL_LOCAL_FOLDER_OUTBOX,
+ receipt, receipt_info, G_PRIORITY_DEFAULT,
NULL, (GAsyncReadyCallback) mdn_receipt_done,
g_object_ref (session));