CamelSession: Make forward_to() method asynchronous.
authorMatthew Barnes <mbarnes@redhat.com>
Sun, 12 Aug 2012 11:09:12 +0000 (07:09 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Sun, 12 Aug 2012 11:09:12 +0000 (07:09 -0400)
commit4006bb1335be48450243127799fd4210ce5fe5c2
tree9dd46d667535f1ebe3f74487ada643c156bae67e
parentbfdc62c9756d07b2ec5f0d1062df6e1f99db9a67
CamelSession: Make forward_to() method asynchronous.

Missed this while converting the rest of Camel to GIO's async pattern,
but came to realize Evolution's forward_to() implementation starts an
asynchronous CamelFolder.append_to() operation and returns TRUE.

So the return value from camel_session_forward_to() does not actually
indicate whether the message was successfully forwarded.  In fact the
caller has no way of knowing!

This calls for an API break.

Split the forward_to() method into synchronous and asynchronous
variations:

  gboolean  (*forward_to_sync)    (CamelSession *session,
                                   CamelFolder *folder,
                                   CamelMimeMessage *message,
                                   const gchar *address,
                                   GCancellable *cancellable,
                                   GError **error);

  void      (*forward_to)         (CamelSession *session,
                                   CamelFolder *folder,
                                   CamelMimeMessage *message,
                                   const gchar *address,
                                   gint io_priority,
                                   GCancellable *cancellable,
                                   GAsyncReadyCallback callback,
                                   gpointer user_data);

  gboolean  (*forward_to_finish)  (CamelSession *session,
                                   GAsyncResult *result,
                                   GError **error);
camel/camel-filter-driver.c
camel/camel-session.c
camel/camel-session.h
docs/reference/camel/camel-sections.txt