diff options
Diffstat (limited to 'mail/mail-ops.c')
-rw-r--r-- | mail/mail-ops.c | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 0a0f80fd93..e57b63445e 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -1802,85 +1802,6 @@ mail_empty_trash (EMailSession *session, mail_msg_slow_ordered_push (m); } -/* ** GET MESSAGE(s) ***************************************************** */ - -struct _get_message_msg { - MailMsg base; - - CamelFolder *folder; - gchar *uid; - void (*done) (CamelFolder *folder, const gchar *uid, CamelMimeMessage *msg, gpointer data); - gpointer data; - CamelMimeMessage *message; - GCancellable *cancellable; -}; - -static gchar * -get_message_desc (struct _get_message_msg *m) -{ - return g_strdup_printf (_("Retrieving message '%s'"), m->uid); -} - -static void -get_message_exec (struct _get_message_msg *m, - GCancellable *cancellable, - GError **error) -{ - if (g_cancellable_is_cancelled (cancellable)) - m->message = NULL; - else - m->message = camel_folder_get_message_sync ( - m->folder, m->uid, cancellable, error); -} - -static void -get_message_done (struct _get_message_msg *m) -{ - if (m->done) - m->done (m->folder, m->uid, m->message, m->data); -} - -static void -get_message_free (struct _get_message_msg *m) -{ - g_free (m->uid); - g_object_unref (m->folder); - g_object_unref (m->cancellable); - - if (m->message) - g_object_unref (m->message); -} - -static MailMsgInfo get_message_info = { - sizeof (struct _get_message_msg), - (MailMsgDescFunc) get_message_desc, - (MailMsgExecFunc) get_message_exec, - (MailMsgDoneFunc) get_message_done, - (MailMsgFreeFunc) get_message_free -}; - -gint -mail_get_message (CamelFolder *folder, const gchar *uid, void (*done) (CamelFolder *folder, const gchar *uid, - CamelMimeMessage *msg, gpointer data), - gpointer data, MailMsgDispatchFunc dispatch) -{ - struct _get_message_msg *m; - gint id; - - m = mail_msg_new (&get_message_info); - m->folder = folder; - g_object_ref (folder); - m->uid = g_strdup (uid); - m->data = data; - m->done = (void (*) (CamelFolder *, const gchar *, CamelMimeMessage *, gpointer )) done; - m->cancellable = camel_operation_new (); - id = m->base.seq; - - dispatch (m); - - return id; -} - /* ** SAVE MESSAGES ******************************************************* */ struct _save_messages_msg { |