X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fmodest-mail-operation.c;h=c9986db290a95519a876d1e550a7efe38cc97373;hp=adee12543afa7e59a1f087a7e4a5b26ee1243794;hb=428bc3f5208923c7ed77f4361d385d3858149efc;hpb=9448e1743b2e38e9a7b0466894a093cb96bc1934 diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index adee125..c9986db 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -63,6 +63,9 @@ #include #include "modest-utils.h" #include "modest-debug.h" +#ifdef MODEST_USE_LIBTIME +#include +#endif #define KB 1024 @@ -1570,6 +1573,7 @@ inbox_refreshed_cb (TnyFolder *inbox, ModestAccountRetrieveType retrieve_type; TnyList *new_headers = NULL; gboolean headers_only, ignore_limit; + time_t time_to_store; info = (UpdateAccountInfo *) user_data; priv = MODEST_MAIL_OPERATION_GET_PRIVATE (info->mail_op); @@ -1600,7 +1604,14 @@ inbox_refreshed_cb (TnyFolder *inbox, } /* Set the last updated as the current time */ - modest_account_mgr_set_last_updated (mgr, tny_account_get_id (priv->account), time (NULL)); +#ifdef MODEST_USE_LIBTIME + struct tm utc_tm; + time_get_utc (&utc_tm); + time_to_store = time_mktime (&utc_tm, "GMT"); +#else + time_to_store = time (NULL); +#endif + modest_account_mgr_set_last_updated (mgr, tny_account_get_id (priv->account), time_to_store); /* Get the message max size */ max_size = modest_conf_get_int (modest_runtime_get_conf (), @@ -2862,9 +2873,11 @@ modest_mail_operation_remove_msgs (ModestMailOperation *self, local_account = (ModestTnyLocalFoldersAccount *) modest_tny_account_store_get_local_folders_account (accstore); - g_object_unref (folder); - folder = modest_tny_local_folders_account_get_merged_outbox (local_account); folder_type = modest_tny_folder_get_local_or_mmc_folder_type (folder); + if (folder_type == TNY_FOLDER_TYPE_OUTBOX) { + g_object_unref (folder); + folder = modest_tny_local_folders_account_get_merged_outbox (local_account); + } g_object_unref (local_account); }