diff options
author | Milan Crha <mcrha@redhat.com> | 2011-08-16 03:31:41 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-08-16 03:31:41 +0800 |
commit | 4ba4bdd01266ce0c3642f92093f4ff2e09348fff (patch) | |
tree | db7d972ea5d968cfe847d182c26074ba3a534d1e /mail | |
parent | 4296c1b0c5c1a011ad3751280eeead92a045c635 (diff) | |
download | gsoc2013-evolution-4ba4bdd01266ce0c3642f92093f4ff2e09348fff.tar gsoc2013-evolution-4ba4bdd01266ce0c3642f92093f4ff2e09348fff.tar.gz gsoc2013-evolution-4ba4bdd01266ce0c3642f92093f4ff2e09348fff.tar.bz2 gsoc2013-evolution-4ba4bdd01266ce0c3642f92093f4ff2e09348fff.tar.lz gsoc2013-evolution-4ba4bdd01266ce0c3642f92093f4ff2e09348fff.tar.xz gsoc2013-evolution-4ba4bdd01266ce0c3642f92093f4ff2e09348fff.tar.zst gsoc2013-evolution-4ba4bdd01266ce0c3642f92093f4ff2e09348fff.zip |
Notify about all newly received messages since the last check
Diffstat (limited to 'mail')
-rw-r--r-- | mail/mail-folder-cache.c | 8 |
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 |