Re: tny_send_queue_add_async
- From: Sergio Villar Senin <svillar igalia com>
- To: tinymail-devel-list gnome org
- Subject: Re: tny_send_queue_add_async
- Date: Wed, 23 Jan 2008 16:33:30 +0100
Philip Van Hoof wrote:
> On Wed, 2008-01-23 at 10:49 +0100, Sergio Villar Senin wrote:
>> Hi,
>>
>> why not adding the tny_send_queue_add_async to the interface because we
>> have it at Camel level?
>
> Yes, good question.
>
> I accept patches between 9:00PM and 8:59PM
This is the patch.
Br
Index: libtinymail-camel/tny-camel-send-queue.c
===================================================================
--- libtinymail-camel/tny-camel-send-queue.c (revision 3289)
+++ libtinymail-camel/tny-camel-send-queue.c (revision 3290)
@@ -1057,6 +1057,7 @@
TnySendQueueIface *klass = (TnySendQueueIface *)g;
klass->add_func = tny_camel_send_queue_add;
+ klass->add_async_func = tny_camel_send_queue_add_async;
klass->get_outbox_func = tny_camel_send_queue_get_outbox;
klass->get_sentbox_func = tny_camel_send_queue_get_sentbox;
klass->cancel_func = tny_camel_send_queue_cancel;
Index: ChangeLog
===================================================================
--- ChangeLog (revision 3289)
+++ ChangeLog (revision 3290)
@@ -1,3 +1,11 @@
+2008-01-23 Sergio Villar Senin <svillar igalia com>
+
+ * libtinymail/tny-send-queue.c
+ libtinymail-camel/tny-camel-send-queue.c
+ libtinymail-camel/tny-camel-send-queue.h
+ (tny_send_queue_add_async): added this method that was available in
+ the Camel implementation to the interface
+
2008-01-22 Philip Van Hoof <pvanhoof gnome org>
* Added support for GtkHTML in libtinymailui-gtkhtml. This is highly
Index: libtinymail/tny-send-queue.c
===================================================================
--- libtinymail/tny-send-queue.c (revision 3289)
+++ libtinymail/tny-send-queue.c (revision 3290)
@@ -149,7 +149,36 @@
return;
}
+/**
+ * tny_send_queue_add_async:
+ * @self: A #TnySendQueue
+ * @msg: a #TnyMsg
+ * @callback: (null-ok): a #TnySendQueueAddCallback or NULL
+ * @status_callback: (null-ok): a #TnyStatusCallback or NULL
+ * @user_data: (null-ok): user data that will be passed to the callbacks
+ *
+ * Add a message to the send queue, usually adding it to the outbox
+ * too. The caller will be notified in the callback function when the
+ * operation finishes.
+ *
+ * since: 1.0
+ * audience: application-developer
+ **/
+void
+tny_send_queue_add_async (TnySendQueue *self, TnyMsg *msg, TnySendQueueAddCallback callback, TnyStatusCallback status_callback, gpointer user_data)
+{
+#ifdef DBC /* require */
+ g_assert (TNY_IS_SEND_QUEUE (self));
+ g_assert (msg);
+ g_assert (TNY_IS_MSG (msg));
+ g_assert (TNY_SEND_QUEUE_GET_IFACE (self)->add_async_func != NULL);
+#endif
+ TNY_SEND_QUEUE_GET_IFACE (self)->add_async_func (self, msg, callback, status_callback, user_data);
+ return;
+}
+
+
static void
tny_send_queue_base_init (gpointer g_class)
{
Index: libtinymail/tny-send-queue.h
===================================================================
--- libtinymail/tny-send-queue.h (revision 3289)
+++ libtinymail/tny-send-queue.h (revision 3290)
@@ -68,6 +68,7 @@
/* methods */
void (*add_func) (TnySendQueue *self, TnyMsg *msg, GError **err);
+ void (*add_async_func) (TnySendQueue *self, TnyMsg *msg, TnySendQueueAddCallback callback, TnyStatusCallback status_callback, gpointer user_data);
TnyFolder* (*get_sentbox_func) (TnySendQueue *self);
TnyFolder* (*get_outbox_func) (TnySendQueue *self);
void (*cancel_func) (TnySendQueue *self, TnySendQueueCancelAction cancel_action, GError **err);
@@ -77,6 +78,7 @@
GType tny_send_queue_get_type (void);
void tny_send_queue_add (TnySendQueue *self, TnyMsg *msg, GError **err);
+void tny_send_queue_add_async (TnySendQueue *self, TnyMsg *msg, TnySendQueueAddCallback callback, TnyStatusCallback status_callback, gpointer user_data);
TnyFolder* tny_send_queue_get_sentbox (TnySendQueue *self);
TnyFolder* tny_send_queue_get_outbox (TnySendQueue *self);
void tny_send_queue_cancel (TnySendQueue *self, TnySendQueueCancelAction cancel_action, GError **err);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]