X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-utils.c;h=4447e5ef3dd34d7d5d976e3f7b1c3da89d7c64a9;hp=aac37ef345089a41bfa481352dffbc8a7903cba1;hb=601c3222c5fe3a42a573e4cdaa708369898cfadc;hpb=33becceaa316d6e701008e34f4160a0631136583 diff --git a/src/modest-utils.c b/src/modest-utils.c index aac37ef..4447e5e 100644 --- a/src/modest-utils.c +++ b/src/modest-utils.c @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -1140,3 +1141,27 @@ modest_utils_free_notification_list (GList *notification_list) g_list_foreach (notification_list, free_notification_data, NULL); g_list_free (notification_list); } + +void +modest_utils_flush_send_queue (const gchar *account_id) +{ + TnyTransportAccount *account; + + /* Get the transport account */ + account = (TnyTransportAccount *) + modest_tny_account_store_get_server_account (modest_runtime_get_account_store (), + account_id, + TNY_ACCOUNT_TYPE_TRANSPORT); + if (account) { + ModestMailOperation *wakeup_op; + ModestTnySendQueue *send_queue = modest_runtime_get_send_queue (account, TRUE); + + /* Flush it! */ + wakeup_op = modest_mail_operation_new (NULL); + modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), + wakeup_op); + modest_mail_operation_queue_wakeup (wakeup_op, send_queue); + + g_object_unref (account); + } +}