diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2012-08-15 06:20:48 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2012-08-15 23:44:29 +0800 |
commit | cbf51737faf61d88c3b7c5349b5db635b892c2c1 (patch) | |
tree | 0bc436489470b182a045e34679dab07bdf97f08f /mail | |
parent | 3aa74ebe41c3d30c0e22dabd2c27c215a90d0c73 (diff) | |
download | gsoc2013-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 'mail')
-rw-r--r-- | mail/em-composer-utils.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index b107745ee9..c01ec85913 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -874,7 +874,7 @@ em_utils_composer_save_to_drafts_cb (EMsgComposer *composer, } static void -composer_save_to_outbox_completed (CamelFolder *outbox_folder, +composer_save_to_outbox_completed (EMailSession *session, GAsyncResult *result, AsyncContext *context) { @@ -883,8 +883,8 @@ composer_save_to_outbox_completed (CamelFolder *outbox_folder, alert_sink = e_activity_get_alert_sink (context->activity); - e_mail_folder_append_message_finish ( - outbox_folder, result, NULL, &error); + e_mail_session_append_to_local_folder_finish ( + session, result, NULL, &error); if (e_activity_handle_cancellation (context->activity, error)) { g_error_free (error); @@ -901,7 +901,7 @@ composer_save_to_outbox_completed (CamelFolder *outbox_folder, /* special processing for Outbox folder */ manage_x_evolution_replace_outbox ( - context->composer, context->session, context->message, + context->composer, session, context->message, e_activity_get_cancellable (context->activity)); e_activity_set_state (context->activity, E_ACTIVITY_COMPLETED); @@ -923,28 +923,22 @@ em_utils_composer_save_to_outbox_cb (EMsgComposer *composer, EMailSession *session) { AsyncContext *context; - CamelFolder *outbox_folder; CamelMessageInfo *info; GCancellable *cancellable; context = g_slice_new0 (AsyncContext); context->message = g_object_ref (message); - context->session = g_object_ref (session); context->composer = g_object_ref (composer); context->activity = g_object_ref (activity); cancellable = e_activity_get_cancellable (activity); - outbox_folder = - e_mail_session_get_local_folder ( - session, E_MAIL_LOCAL_FOLDER_OUTBOX); - info = camel_message_info_new (NULL); camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, ~0); - e_mail_folder_append_message ( - outbox_folder, message, info, - G_PRIORITY_DEFAULT, cancellable, + e_mail_session_append_to_local_folder ( + session, E_MAIL_LOCAL_FOLDER_OUTBOX, + message, info, G_PRIORITY_DEFAULT, cancellable, (GAsyncReadyCallback) composer_save_to_outbox_completed, context); |