From cbf51737faf61d88c3b7c5349b5db635b892c2c1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 14 Aug 2012 18:20:48 -0400 Subject: Add e_mail_session_append_to_local_folder(). Asynchronous + synchronous convenience functions. Uses the EMailLocalFolder enumeration to specify a well-known folder. --- plugins/templates/templates.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/templates/templates.c b/plugins/templates/templates.c index 4359af01b9..f218bce9a4 100644 --- a/plugins/templates/templates.c +++ b/plugins/templates/templates.c @@ -37,8 +37,7 @@ #include -#include -#include +#include #include #include @@ -1157,7 +1156,6 @@ got_message_draft_cb (EMsgComposer *composer, EMailSession *session; CamelMimeMessage *message; CamelMessageInfo *info; - CamelFolder *folder; GError *error = NULL; message = e_msg_composer_get_message_draft_finish ( @@ -1188,10 +1186,6 @@ got_message_draft_cb (EMsgComposer *composer, backend = E_MAIL_BACKEND (shell_backend); session = e_mail_backend_get_session (backend); - /* Get the templates folder and all UIDs of the messages there. */ - folder = e_mail_session_get_local_folder ( - session, E_MAIL_LOCAL_FOLDER_TEMPLATES); - info = camel_message_info_new (NULL); /* The last argument is a bit mask which tells the function @@ -1200,9 +1194,11 @@ got_message_draft_cb (EMsgComposer *composer, camel_message_info_set_flags ( info, CAMEL_MESSAGE_SEEN | CAMEL_MESSAGE_DRAFT, ~0); - /* FIXME No async callback, so... hope for the best? */ - e_mail_folder_append_message ( - folder, message, info, G_PRIORITY_DEFAULT, + /* FIXME Should submit an EActivity for this + * operation, same as saving to Outbox. */ + e_mail_session_append_to_local_folder ( + session, E_MAIL_LOCAL_FOLDER_TEMPLATES, + message, info, G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) NULL, NULL); g_object_unref (message); -- cgit v1.2.3