+ TnyAccountStore *acc_store;
+
+ acc_store = TNY_ACCOUNT_STORE (modest_runtime_get_account_store ());
+
+ /* Cache dir is different in case we're using an external storage (like MMC account) */
+ if (mail_op) {
+ TnyAccount *account = modest_mail_operation_get_account (mail_op);
+ if (account) {
+ if (modest_tny_account_is_memory_card_account (account)) {
+ cache_dir = g_getenv (MODEST_MMC1_VOLUMEPATH_ENV);
+ }
+ g_object_unref (account);
+ }
+ }
+
+ /* Get the default local cache dir */
+ if (!cache_dir)
+ cache_dir = tny_account_store_get_cache_dir (acc_store);