Fixes NB#105818, show the proper message when sending fails
[modest] / src / modest-mail-operation.c
index 01787e0..c0e721c 100644 (file)
@@ -1433,7 +1433,7 @@ update_account_send_mail (UpdateAccountInfo *info)
                                g_warning ("%s: could not get outbox", __FUNCTION__);
                                num_messages = 0;
                        }
-               
+
                        if (num_messages != 0) {
                                ModestMailOperation *mail_op;
                                /* Reenable suspended items */
@@ -1441,9 +1441,8 @@ update_account_send_mail (UpdateAccountInfo *info)
                                modest_mail_operation_queue_add (modest_runtime_get_mail_operation_queue (),
                                                                 mail_op);
                                modest_mail_operation_queue_wakeup (mail_op, MODEST_TNY_SEND_QUEUE (send_queue));
-                               
+
                                /* Try to send */
-                               tny_camel_send_queue_flush (TNY_CAMEL_SEND_QUEUE (send_queue));
                                modest_tny_send_queue_set_requested_send_receive (MODEST_TNY_SEND_QUEUE (send_queue), 
                                                                                  info->interactive);
                        }
@@ -2192,7 +2191,6 @@ transfer_folder_status_cb (GObject *obj,
        g_slice_free (ModestMailOperationState, state);
 }
 
-
 static void
 transfer_folder_cb (TnyFolder *folder, 
                    gboolean cancelled, 
@@ -2206,7 +2204,7 @@ transfer_folder_cb (TnyFolder *folder,
        ModestMailOperationPrivate *priv = NULL;
 
        helper = (XFerFolderAsyncHelper *) user_data;
-       g_return_if_fail (helper != NULL);       
+       g_return_if_fail (helper != NULL);
 
        self = helper->mail_op;
        priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
@@ -2225,7 +2223,11 @@ transfer_folder_cb (TnyFolder *folder,
                priv->done = 1;
                priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
        }
-               
+
+       /* Update state of new folder */
+       tny_folder_refresh_async (new_folder, NULL, NULL, NULL);
+       tny_folder_poke_status (new_folder);
+
        /* Notify about operation end */
        modest_mail_operation_notify_end (self);
 
@@ -3435,6 +3437,7 @@ queue_wakeup_callback (ModestTnySendQueue *queue,
        priv = MODEST_MAIL_OPERATION_GET_PRIVATE (mail_op);
 
        priv->status = MODEST_MAIL_OPERATION_STATUS_SUCCESS;
+       tny_camel_send_queue_flush (TNY_CAMEL_SEND_QUEUE (queue));
 
        /* Notify end */
        modest_mail_operation_notify_end (mail_op);