} else if (TNY_IS_FOLDER (folder_store)) {
/* Get the folder's parent account: */
- account = tny_folder_get_account(TNY_FOLDER (folder_store));
+ account = tny_folder_get_account (TNY_FOLDER (folder_store));
} else if (TNY_IS_ACCOUNT (folder_store)) {
/* Use the folder store as an account: */
- account = TNY_ACCOUNT (folder_store);
+ account = TNY_ACCOUNT (g_object_ref (folder_store));
}
if (tny_account_get_account_type (account) == TNY_ACCOUNT_TYPE_STORE) {
if (!TNY_IS_CAMEL_POP_STORE_ACCOUNT (account) &&
!TNY_IS_CAMEL_IMAP_STORE_ACCOUNT (account)) {
-
- /* This IS a local account like a maildir account, which does not require
- * a connection. (original comment had a vague assumption in its language
- * usage. There's no assuming needed, this IS what it IS: a local account), */
- /* We promise to instantly perform the callback, so ... */
- if (callback) {
+ /* No need to connect a local account */
+ if (callback)
callback (FALSE, NULL, parent_window, account, user_data);
- }
-
- return;
+
+ goto clean;
}
}
+ modest_platform_connect_and_perform (parent_window, force, account, callback, user_data);
- modest_platform_connect_and_perform (parent_window, force, account, callback, user_data);
-
- return;
+ clean:
+ if (account)
+ g_object_unref (account);
}
static void
GnomeVFSVolume *volume,
gpointer user_data);
-static void modest_tny_account_store_forget_password_in_memory (ModestTnyAccountStore *self,
- const gchar *server_account_name);
+static void forget_password_in_memory (ModestTnyAccountStore *self,
+ const gchar *server_account_name);
static void add_connection_specific_transport_accounts (ModestTnyAccountStore *self);
}
/**
- * modest_tny_account_store_forget_password_in_memory
+ * forget_password_in_memory
* @self: a TnyAccountStore instance
* @account: A server account.
*
* For instance, this should be called when the user has changed the password in the account settings.
*/
static void
-modest_tny_account_store_forget_password_in_memory (ModestTnyAccountStore *self, const gchar * server_account_name)
+forget_password_in_memory (ModestTnyAccountStore *self,
+ const gchar * server_account_name)
{
- /* printf ("DEBUG: %s\n", __FUNCTION__); */
ModestTnyAccountStorePrivate *priv = MODEST_TNY_ACCOUNT_STORE_GET_PRIVATE(self);
if (server_account_name && priv->password_hash) {
if (account) {
/* Forget any cached password for the account, so that
we use a new account if any */
- modest_tny_account_store_forget_password_in_memory (self,
- tny_account_get_id (account));
+ forget_password_in_memory (self, tny_account_get_id (account));
/* Install a signal handler that will refresh the
account the first time it becomes online. Do this
/* If there was any problem creating the account, for example,
with the configuration system this could not exist */
if (store_account) {
+ /* Forget any cached password for the account */
+ forget_password_in_memory (self, tny_account_get_id (store_account));
+
/* Remove it from the list of accounts and notify the
observers. Do not need to wait for account
disconnection */
TnyAccount *local_account = NULL;
TnyFolder *outbox = NULL;
+ /* Forget any cached password for the account */
+ forget_password_in_memory (self, tny_account_get_id (store_account));
+
/* Remove it from the list of accounts and notify the
observers. Do not need to wait for account
disconnection */