- if (TNY_IS_FOLDER_STORE (current)) {
- if (TNY_IS_ACCOUNT (current)) {
- visible_id = g_strdup (tny_account_get_id (TNY_ACCOUNT (current)));
- } else if (TNY_IS_FOLDER (current)) {
- TnyAccount *account;
-
- account = tny_folder_get_account (TNY_FOLDER (current));
- if (account) {
- visible_id = g_strdup (tny_account_get_id (TNY_ACCOUNT (current)));
+ if (TNY_IS_ACCOUNT (current)) {
+ /* Local folders and MMC account are always shown
+ along with the currently visible server account */
+ if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (current)) ||
+ modest_tny_account_is_memory_card_account (TNY_ACCOUNT (current)))
+ visible_id = g_object_get_data ((GObject *) picker, FOLDER_PICKER_ORIGINAL_ACCOUNT);
+ else
+ visible_id = tny_account_get_id (TNY_ACCOUNT (current));
+ } else if (TNY_IS_FOLDER (current)) {
+ TnyAccount *account;
+ account = modest_tny_folder_get_account ((TnyFolder *) current);
+ if (account) {
+ if (modest_tny_account_is_virtual_local_folders (TNY_ACCOUNT (account)) ||
+ modest_tny_account_is_memory_card_account (TNY_ACCOUNT (account))) {
+ visible_id = g_object_get_data ((GObject *) picker, FOLDER_PICKER_ORIGINAL_ACCOUNT);
+ } else {
+ visible_id = tny_account_get_id (account);