-
-static gboolean
-action_send (const gchar* account_name)
-{
- TnyAccount *tny_account;
- ModestTnySendQueue *send_queue;
-
- g_return_val_if_fail (account_name, FALSE);
-
- /* Get the transport account according to the open connection,
- * because the account might specify connection-specific SMTP servers.
- */
- tny_account =
- modest_tny_account_store_get_transport_account_for_open_connection (modest_runtime_get_account_store(),
- account_name);
- if (!tny_account) {
- g_printerr ("modest: cannot get tny transport account for %s\n", account_name);
- return FALSE;
- }
-
- send_queue = modest_tny_send_queue_new (TNY_CAMEL_TRANSPORT_ACCOUNT(tny_account));
- if (!send_queue) {
- g_object_unref (G_OBJECT(tny_account));
- g_printerr ("modest: cannot get send queue for %s\n", account_name);
- return FALSE;
- }
-
- modest_tny_send_queue_flush (send_queue);
-
- g_object_unref (G_OBJECT(send_queue));
- g_object_unref (G_OBJECT(tny_account));
-
- return TRUE;
-}
-
-
-static gboolean
-action_receive (const gchar* account_name,
- ModestWindow *win)
-{
- TnyAccount *tny_account;
- ModestMailOperation *mail_op;
-
- g_return_val_if_fail (account_name, FALSE);
-
- tny_account =
- modest_tny_account_store_get_tny_account_by_account (modest_runtime_get_account_store(),
- account_name,
- TNY_ACCOUNT_TYPE_STORE);
- if (!tny_account) {
- g_printerr ("modest: cannot get tny store account for %s\n", account_name);
- return FALSE;
- }
-
- /* Create the mail operation */
- /* TODO: The spec wants us to first do any pending deletions, before receiving. */
- mail_op = modest_mail_operation_new (MODEST_MAIL_OPERATION_ID_RECEIVE, G_OBJECT(win));
- modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (), mail_op);
- modest_mail_operation_update_account (mail_op, TNY_STORE_ACCOUNT(tny_account));
-
- g_object_unref (G_OBJECT(tny_account));
- g_object_unref (G_OBJECT (mail_op));
-
- return TRUE;
-}
-