X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-mail-operation.c;h=79a3d7e42f7195c65d1874ccb956669cf34488e6;hp=6bd42b3d678c9f23a5beb151a80d6e7f951853fc;hb=6f7aa1b5e15f3024db75ccfe3138f520c607dc5d;hpb=ff041741b15caa9e663249315645251362eb4924 diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 6bd42b3..79a3d7e 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1289,10 +1289,17 @@ static void update_account_send_mail (UpdateAccountInfo *info) { TnyTransportAccount *transport_account = NULL; + ModestTnyAccountStore *account_store; + + account_store = modest_runtime_get_account_store (); + + /* We don't try to send messages while sending mails is blocked */ + if (modest_tny_account_store_is_send_mail_blocked (account_store)) + return; /* Get the transport account */ transport_account = (TnyTransportAccount *) - modest_tny_account_store_get_transport_account_for_open_connection (modest_runtime_get_account_store(), + modest_tny_account_store_get_transport_account_for_open_connection (account_store, info->account_name); if (transport_account) { @@ -1650,7 +1657,7 @@ recurse_folders_async_cb (TnyFolderStore *folder_store, /* Add pending call */ info->pending_calls++; - tny_folder_store_get_folders_async (folder, folders, NULL, + tny_folder_store_get_folders_async (folder, folders, NULL, FALSE, recurse_folders_async_cb, NULL, info); g_object_unref (folders); @@ -1801,7 +1808,7 @@ modest_mail_operation_update_account (ModestMailOperation *self, /* Get all folders and continue in the callback */ folders = tny_simple_list_new (); tny_folder_store_get_folders_async (TNY_FOLDER_STORE (priv->account), - folders, NULL, + folders, NULL, FALSE, recurse_folders_async_cb, NULL, info); g_object_unref (folders); @@ -2621,14 +2628,15 @@ remove_msgs_async_cb (TnyFolder *folder, { gboolean expunge, leave_on_server; const gchar *account_name; - const gchar *proto; TnyAccount *account; - ModestTransportStoreProtocol account_proto = MODEST_PROTOCOL_TRANSPORT_STORE_UNKNOWN; + ModestProtocolType account_proto = MODEST_PROTOCOL_REGISTRY_TYPE_INVALID; ModestMailOperation *self; ModestMailOperationPrivate *priv; + ModestProtocolRegistry *protocol_registry; self = (ModestMailOperation *) user_data; priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self); + protocol_registry = modest_runtime_get_protocol_registry (); if (canceled || err) { /* If canceled by the user, ignore the error given by Tinymail */ @@ -2650,14 +2658,11 @@ remove_msgs_async_cb (TnyFolder *folder, leave_on_server = modest_account_mgr_get_leave_on_server (modest_runtime_get_account_mgr (), account_name); - proto = tny_account_get_proto (account); + account_proto = modest_tny_account_get_protocol_type (account); g_object_unref (account); - - if (proto) - account_proto = modest_protocol_info_get_transport_store_protocol (proto); - if (((account_proto == MODEST_PROTOCOL_STORE_POP) && !leave_on_server) || - modest_tny_folder_is_remote_folder (folder) == FALSE) + if (( (modest_protocol_registry_protocol_type_has_leave_on_server (protocol_registry, account_proto) && !leave_on_server) || + modest_tny_folder_is_remote_folder (folder) == FALSE)) expunge = TRUE; else expunge = FALSE; @@ -2964,12 +2969,16 @@ modest_mail_operation_xfer_msgs (ModestMailOperation *self, TnyAccount *dst_account = NULL; gboolean leave_on_server; ModestMailOperationState *state; + ModestProtocolRegistry *protocol_registry; + ModestProtocolType account_protocol; g_return_if_fail (self && MODEST_IS_MAIL_OPERATION (self)); g_return_if_fail (headers && TNY_IS_LIST (headers)); g_return_if_fail (folder && TNY_IS_FOLDER (folder)); priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self); + protocol_registry = modest_runtime_get_protocol_registry (); + priv->total = tny_list_get_length (headers); priv->done = 0; priv->status = MODEST_MAIL_OPERATION_STATUS_IN_PROGRESS; @@ -3060,8 +3069,8 @@ modest_mail_operation_xfer_msgs (ModestMailOperation *self, this could cause an error if we're offline while transferring an already downloaded message from a POP account */ - if (modest_protocol_info_get_transport_store_protocol (tny_account_get_proto (priv->account)) == - MODEST_PROTOCOL_STORE_POP) { + account_protocol = modest_tny_account_get_protocol_type (priv->account); + if (modest_protocol_registry_protocol_type_has_leave_on_server (protocol_registry, account_protocol)) { const gchar *account_name; account_name = modest_tny_account_get_parent_modest_account_name_for_server_account (priv->account);