X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fmodest-mail-operation.c;h=39d16299d361bf216cdcc0a9b028cf9e9c4f3c9f;hb=2bedf05646b777d37f19178e989c6112b1544b2a;hp=30f1a57e7c36a9b067447974358c3f5dba1b8689;hpb=f34695cc046a41df511b47a38e043679560893f4;p=modest diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 30f1a57..39d1629 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1329,8 +1329,7 @@ G_DEFINE_TYPE_WITH_CODE (InternalFolderObserver, static void foreach_add_item (gpointer header, gpointer user_data) { - tny_list_prepend (TNY_LIST (user_data), - G_OBJECT (header)); + tny_list_append (TNY_LIST (user_data), G_OBJECT (header)); } /* This is the method that looks for new messages in a folder */ @@ -1411,9 +1410,9 @@ update_account_send_mail (UpdateAccountInfo *info) return; /* Get the transport account */ - transport_account = (TnyTransportAccount *) - modest_tny_account_store_get_transport_account_for_open_connection (account_store, - info->account_name); + transport_account = (TnyTransportAccount *) + modest_tny_account_store_get_server_account (account_store, info->account_name, + TNY_ACCOUNT_TYPE_TRANSPORT); if (transport_account) { ModestTnySendQueue *send_queue; @@ -1536,7 +1535,7 @@ inbox_refreshed_cb (TnyFolder *inbox, UpdateAccountInfo *info; ModestMailOperationPrivate *priv; TnyIterator *new_headers_iter; - GPtrArray *new_headers_array = NULL; + GPtrArray *new_headers_array = NULL; gint max_size, retrieve_limit, i; ModestAccountMgr *mgr; ModestAccountRetrieveType retrieve_type; @@ -1547,9 +1546,6 @@ inbox_refreshed_cb (TnyFolder *inbox, priv = MODEST_MAIL_OPERATION_GET_PRIVATE (info->mail_op); mgr = modest_runtime_get_account_mgr (); - /* Set the last updated as the current time, do it even if the inbox refresh failed */ - modest_account_mgr_set_last_updated (mgr, tny_account_get_id (priv->account), time (NULL)); - if (canceled || err) { priv->status = MODEST_MAIL_OPERATION_STATUS_FAILED; if (err) @@ -1573,6 +1569,9 @@ inbox_refreshed_cb (TnyFolder *inbox, goto send_mail; } + /* Set the last updated as the current time */ + modest_account_mgr_set_last_updated (mgr, tny_account_get_id (priv->account), time (NULL)); + /* Get the message max size */ max_size = modest_conf_get_int (modest_runtime_get_conf (), MODEST_CONF_MSG_SIZE_LIMIT, NULL);