{
g_return_if_fail (account && TNY_IS_ACCOUNT(account));
- if (modest_tny_folder_store_is_remote (TNY_FOLDER_STORE (account)))
- tny_camel_account_set_online (TNY_CAMEL_ACCOUNT(account), FALSE, NULL, NULL);
+ if (TNY_IS_STORE_ACCOUNT (account) &&
+ !modest_tny_folder_store_is_remote (TNY_FOLDER_STORE (account)))
+ return;
+
+ tny_camel_account_set_online (TNY_CAMEL_ACCOUNT(account), FALSE, NULL, NULL);
}
g_return_val_if_fail (account_name, FALSE);
g_return_val_if_fail (tny_account, FALSE);
- tny_account_set_id (tny_account, account_name);
+ /* Do not change the id if it's not needed */
+ if (tny_account_get_id (tny_account) &&
+ strcmp (tny_account_get_id (tny_account), account_name))
+ tny_account_set_id (tny_account, account_name);
/* mbox and maildir accounts use a URI instead of the rest:
* Note that this is not where we create the special local folders account.