* Now we block sending mails (from any account) when we're changing
[modest] / src / modest-tny-account-store.c
index bed758f..bae02de 100644 (file)
@@ -144,6 +144,9 @@ struct _ModestTnyAccountStorePrivate {
        
        /* Matches transport accounts and outbox folder */
        GHashTable          *outbox_of_transport;
+
+       /* is sending mail blocked? */
+       gboolean send_mail_blocked;
 };
 
 #define MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
@@ -265,6 +268,7 @@ modest_tny_account_store_instance_init (ModestTnyAccountStore *obj)
        priv->session                = NULL;
        priv->device                 = NULL;
        priv->sighandlers            = NULL;
+       priv->send_mail_blocked      = FALSE;
        
        priv->outbox_of_transport = g_hash_table_new_full (g_direct_hash,
                                                           g_direct_equal,
@@ -1159,7 +1163,8 @@ modest_tny_account_store_alert (TnyAccountStore *self,
 
        if (error->code == TNY_SERVICE_ERROR_CERTIFICATE)
                retval = modest_platform_run_certificate_confirmation_dialog (server_name,
-                                                                             error->message);
+                                                                             error->message,
+                                                                             TRUE);
        else if (error->code == TNY_SERVICE_ERROR_AUTHENTICATE) {
                modest_platform_run_information_dialog (NULL, prompt, TRUE);
 
@@ -2194,3 +2199,24 @@ modest_tny_account_store_show_account_settings_dialog (ModestTnyAccountStore *se
        }
        
 }
+
+gboolean 
+modest_tny_account_store_is_send_mail_blocked (ModestTnyAccountStore *self)
+{
+       ModestTnyAccountStorePrivate *priv;
+
+       priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
+
+       return priv->send_mail_blocked;
+}
+
+void 
+modest_tny_account_store_set_send_mail_blocked (ModestTnyAccountStore *self, 
+                                               gboolean blocked)
+{
+       ModestTnyAccountStorePrivate *priv;
+
+       priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
+
+       priv->send_mail_blocked = blocked;
+}