* Partially fixes NB#63761, Modest does not try to connect to send a new message, we still need that tinymail does not try to send if the device is offline in order to avoid an error message
* Added some missing account registrations in the mail operations
pmo-trunk-r3472
priv = MODEST_MAIL_OPERATION_GET_PRIVATE(self);
priv->op_type = MODEST_MAIL_OPERATION_TYPE_SEND;
+ priv->account = TNY_ACCOUNT (g_object_ref (transport_account));
/* Check parametters */
if (to == NULL) {
goto error;
}
+ priv->account = g_object_ref (store_account);
/* Get the transport account, we can not do it in the thread
due to some problems with dbus */
priv = MODEST_MAIL_OPERATION_GET_PRIVATE (self);
priv->op_type = MODEST_MAIL_OPERATION_TYPE_INFO;
+ priv->account = (TNY_IS_ACCOUNT (parent)) ?
+ g_object_ref (parent) :
+ modest_tny_folder_get_account (TNY_FOLDER (parent));
/* Check for already existing folder */
if (modest_tny_folder_has_subfolder_with_name (parent, name)) {
folder = tny_header_get_folder (header);
if (folder) {
priv->account = modest_tny_folder_get_account (TNY_FOLDER(folder));
-
g_object_unref (folder);
}
-
g_object_unref (header);
}
g_return_if_fail (TNY_IS_CAMEL_MSG(msg));
tny_camel_send_queue_add_async (TNY_CAMEL_SEND_QUEUE(self),
- msg,
- _on_added_to_outbox,
- NULL,
- NULL);
+ msg,
+ _on_added_to_outbox,
+ NULL,
+ NULL);
}
if (!modest_msg_edit_window_check_names (edit_window, TRUE))
return;
- /* Offer the connection dialog, if necessary: */
- if (!modest_platform_connect_and_wait (GTK_WINDOW (edit_window), NULL))
- return;
-
/* FIXME: Code added just for testing. The final version will
use the send queue provided by tinymail and some
classifier */
ModestFolderViewPrivate *priv;
GtkTreeModel *sort_model, *filter_model;
GtkTreeSelection *sel = NULL;
+ TnyAccount *folder_selected_account;
/* Ignore transport account removals, we're not showing them
in the folder view */
MODEST_CONF_FOLDER_VIEW_KEY);
}
- /* Select the INBOX */
- modest_folder_view_select_first_inbox_or_local (self);
+ /* Select the first INBOX if the currently selected folder
+ belongs to the account that is being deleted */
+ folder_selected_account = (TNY_IS_FOLDER (priv->cur_folder_store)) ?
+ modest_tny_folder_get_account (TNY_FOLDER (priv->cur_folder_store)) :
+ TNY_ACCOUNT (g_object_ref (priv->cur_folder_store));
+ if (account == folder_selected_account)
+ modest_folder_view_select_first_inbox_or_local (self);
+ g_object_unref (folder_selected_account);
}
void
#define __MODEST_MSG_VIEW_WINDOW_H__
#include <tny-msg.h>
+#include <tny-folder.h>
#include <widgets/modest-window.h>
#include <gtk/gtktreemodel.h>