+
+void
+modest_utils_flush_send_queue (const gchar *account_id)
+{
+ TnyTransportAccount *account;
+
+ /* Get the transport account */
+ account = (TnyTransportAccount *)
+ modest_tny_account_store_get_tny_account_by (modest_runtime_get_account_store (),
+ MODEST_TNY_ACCOUNT_STORE_QUERY_ID,
+ account_id);
+
+ if (account) {
+ ModestTnySendQueue *send_queue = modest_runtime_get_send_queue (account, TRUE);
+
+ /* Flush it! */
+ tny_camel_send_queue_flush ((TnyCamelSendQueue *) send_queue);
+
+ g_object_unref (account);
+ }
+}