aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2011-08-16 03:31:41 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-09-14 20:08:50 +0800
commitc34f5d0503572d1942671d9047ee56d25e3d40ff (patch)
treebe5621de7fdc8c20feb310029184c7a8053f83ec
parentb3b0cf89b137018c50b42d4162c7a3dab195d626 (diff)
downloadgsoc2013-evolution-c34f5d0503572d1942671d9047ee56d25e3d40ff.tar.gz
gsoc2013-evolution-c34f5d0503572d1942671d9047ee56d25e3d40ff.tar.zst
gsoc2013-evolution-c34f5d0503572d1942671d9047ee56d25e3d40ff.zip
Notify about all newly received messages since the last check
-rw-r--r--mail/mail-folder-cache.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c
index 4b9d5f500f..152d8fdecd 100644
--- a/mail/mail-folder-cache.c
+++ b/mail/mail-folder-cache.c
@@ -323,7 +323,7 @@ folder_changed_cb (CamelFolder *folder,
MailFolderCache *self)
{
static GHashTable *last_newmail_per_folder = NULL;
- time_t latest_received;
+ time_t latest_received, new_latest_received;
CamelFolder *local_drafts;
CamelFolder *local_outbox;
CamelFolder *local_sent;
@@ -346,6 +346,7 @@ folder_changed_cb (CamelFolder *folder,
/* it's fine to hash them by folder pointer here */
latest_received = GPOINTER_TO_INT (
g_hash_table_lookup (last_newmail_per_folder, folder));
+ new_latest_received = latest_received;
local_drafts = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_DRAFTS);
local_outbox = e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_OUTBOX);
@@ -367,7 +368,8 @@ folder_changed_cb (CamelFolder *folder,
((flags & CAMEL_MESSAGE_JUNK) == 0) &&
((flags & CAMEL_MESSAGE_DELETED) == 0) &&
(camel_message_info_date_received (info) > latest_received)) {
- latest_received = camel_message_info_date_received (info);
+ if (camel_message_info_date_received (info) > new_latest_received)
+ new_latest_received = camel_message_info_date_received (info);
new++;
if (new == 1) {
uid = g_strdup (camel_message_info_uid (info));
@@ -391,7 +393,7 @@ folder_changed_cb (CamelFolder *folder,
if (new > 0)
g_hash_table_insert (
last_newmail_per_folder, folder,
- GINT_TO_POINTER (latest_received));
+ GINT_TO_POINTER (new_latest_received));
g_mutex_lock (self->priv->stores_mutex);
if (self->priv->stores != NULL