From de713f6a394f6939c875049ff05babd97a557c24 Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Thu, 25 Jun 2009 20:08:31 +0200 Subject: [PATCH] Fixes NB#124628, 20 newest messages are not retrieved when the account has been setup Fixes NB#124639, only headers are downloaded when issuing a Send&Receive --- src/hildon2/modest-easysetup-wizard-dialog.c | 5 +++++ src/modest-mail-operation.c | 6 ++++-- src/modest-ui-actions.c | 7 ++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/hildon2/modest-easysetup-wizard-dialog.c b/src/hildon2/modest-easysetup-wizard-dialog.c index b2369a5..c824802 100644 --- a/src/hildon2/modest-easysetup-wizard-dialog.c +++ b/src/hildon2/modest-easysetup-wizard-dialog.c @@ -2321,6 +2321,11 @@ save_to_settings (ModestEasysetupWizardDialog *self) modest_account_settings_set_display_name (priv->settings, display_name); g_free (display_name); g_free (provider_id); + + /* This values are hardcoded for Fremantle */ + modest_account_settings_set_retrieve_type (priv->settings, + MODEST_ACCOUNT_RETRIEVE_MESSAGES_AND_ATTACHMENTS); + modest_account_settings_set_retrieve_limit (priv->settings, 20); } diff --git a/src/modest-mail-operation.c b/src/modest-mail-operation.c index 49e1818..19f8954 100644 --- a/src/modest-mail-operation.c +++ b/src/modest-mail-operation.c @@ -1669,7 +1669,7 @@ inbox_refreshed_cb (TnyFolder *inbox, if the mail operation has a source (this means that was invoked by the user and not automatically by a D-Bus method) */ - if (info->retrieve_all_cb && priv->source) + if (info->retrieve_all_cb && info->interactive) ignore_limit = info->retrieve_all_cb (priv->source, new_headers_array->len, retrieve_limit); @@ -1679,7 +1679,9 @@ inbox_refreshed_cb (TnyFolder *inbox, new_headers = tny_simple_list_new (); for (i=0; i < new_headers_array->len; i++) { TnyHeader *header = TNY_HEADER (g_ptr_array_index (new_headers_array, i)); - tny_list_append (new_headers, G_OBJECT (header)); + /* We want the first element to be the most recent + one, that's why we reverse the list */ + tny_list_prepend (new_headers, G_OBJECT (header)); } g_ptr_array_foreach (new_headers_array, (GFunc) g_object_unref, NULL); g_ptr_array_free (new_headers_array, FALSE); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 75e6fdd..f5dd2fd 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -2179,7 +2179,12 @@ new_messages_arrived (ModestMailOperation *self, flags = tny_header_get_flags (header); if (!(flags & TNY_HEADER_FLAG_SEEN)) { - tny_list_append (actually_new_list, G_OBJECT (header)); + /* Messages are ordered from most + recent to oldest. But we want to + show notifications starting from + the oldest message. That's why we + reverse the list */ + tny_list_prepend (actually_new_list, G_OBJECT (header)); } g_object_unref (header); } -- 1.7.9.5