diff options
author | Not Zed <NotZed@Ximian.com> | 2002-09-27 13:34:05 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-09-27 13:34:05 +0800 |
commit | 636a54437376dcf8b8ad0665fbf82b18cbf02e57 (patch) | |
tree | 2022fb7d1c09064bf5e4a13c2b6c373b2f0d6ef7 /camel/providers/imap/camel-imap-store.c | |
parent | 1dcca79ec4ade696bb31dd9d3914a92ab3fd0cef (diff) | |
download | gsoc2013-evolution-636a54437376dcf8b8ad0665fbf82b18cbf02e57.tar gsoc2013-evolution-636a54437376dcf8b8ad0665fbf82b18cbf02e57.tar.gz gsoc2013-evolution-636a54437376dcf8b8ad0665fbf82b18cbf02e57.tar.bz2 gsoc2013-evolution-636a54437376dcf8b8ad0665fbf82b18cbf02e57.tar.lz gsoc2013-evolution-636a54437376dcf8b8ad0665fbf82b18cbf02e57.tar.xz gsoc2013-evolution-636a54437376dcf8b8ad0665fbf82b18cbf02e57.tar.zst gsoc2013-evolution-636a54437376dcf8b8ad0665fbf82b18cbf02e57.zip |
Use the summary's last uid as the one to fetch from, ignoring the cache.
2002-09-27 Not Zed <NotZed@Ximian.com>
* providers/imap/camel-imap-folder.c (imap_update_summary): Use
the summary's last uid as the one to fetch from, ignoring the
cache. Use strotul instead of atoi as well.
* providers/imap/camel-imap-store.c (get_folder_counts): If we
have the folder open, and the unread count has changed, refresh
it. Should fix #30399 enough. Also in non-check-all mode, if we
have the folder open, use it anyway.
svn path=/trunk/; revision=18242
Diffstat (limited to 'camel/providers/imap/camel-imap-store.c')
-rw-r--r-- | camel/providers/imap/camel-imap-store.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index b23be5f576..fbc1e20555 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -2131,6 +2131,7 @@ static void get_folder_counts(CamelImapStore *imap_store, CamelFolderInfo *fi, CamelException *ex) { GSList *q; + CamelFolder *folder; /* non-recursive breath first search */ @@ -2156,12 +2157,33 @@ get_folder_counts(CamelImapStore *imap_store, CamelFolderInfo *fi, CamelExceptio any operations anyway so this is 'safe'. See comment above imap_store_refresh_folders() for info */ CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(imap_store->current_folder))->refresh_info(imap_store->current_folder, ex); fi->unread_message_count = camel_folder_get_unread_message_count (imap_store->current_folder); - } else + } else { fi->unread_message_count = get_folder_status (imap_store, fi->full_name, "UNSEEN"); + /* if we have this folder open, and the unread count has changed, update */ + CAMEL_STORE_LOCK(imap_store, cache_lock); + folder = g_hash_table_lookup(CAMEL_STORE(imap_store)->folders, fi->full_name); + if (folder && fi->unread_message_count != camel_folder_get_unread_message_count(folder)) + camel_object_ref(folder); + else + folder = NULL; + CAMEL_STORE_UNLOCK(imap_store, cache_lock); + if (folder) { + CAMEL_FOLDER_CLASS (CAMEL_OBJECT_GET_CLASS(folder))->refresh_info(folder, ex); + fi->unread_message_count = camel_folder_get_unread_message_count(folder); + camel_object_unref(folder); + } + } CAMEL_SERVICE_UNLOCK (imap_store, connect_lock); } else { - fi->unread_message_count = -1; + /* since its cheap, get it if they're open */ + CAMEL_STORE_LOCK(imap_store, cache_lock); + folder = g_hash_table_lookup(CAMEL_STORE(imap_store)->folders, fi->full_name); + if (folder) + fi->unread_message_count = camel_folder_get_unread_message_count(folder); + else + fi->unread_message_count = -1; + CAMEL_STORE_UNLOCK(imap_store, cache_lock); } if (fi->child) |