diff options
-rw-r--r-- | camel/ChangeLog | 8 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-message-cache.c | 16 | ||||
-rw-r--r-- | camel/providers/imap/camel-imap-message-cache.h | 3 |
3 files changed, 27 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 29f180d9f8..e832e39c4d 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2001-06-15 Dan Winship <danw@ximian.com> + + * providers/imap/camel-imap-message-cache.c + (camel_imap_message_cache_max_uid): Return the largest real UID in + the cache (as an integer). Eventually to be used for an + optimization in the new-message fetch code. + (cache_put): Keep track of max_uid. + 2001-06-14 Jeffrey Stedfast <fejj@ximian.com> * camel-mime-utils.c: Added Mailing-List header regex so that we diff --git a/camel/providers/imap/camel-imap-message-cache.c b/camel/providers/imap/camel-imap-message-cache.c index 4b9b97789f..2f811eea47 100644 --- a/camel/providers/imap/camel-imap-message-cache.c +++ b/camel/providers/imap/camel-imap-message-cache.c @@ -94,6 +94,11 @@ cache_put (CamelImapMessageCache *cache, const char *uid, const char *key, char *hash_key; GPtrArray *subparts; gpointer okey, ostream; + guint32 uidval; + + uidval = strtoul (uid, NULL, 10); + if (uidval > cache->max_uid) + cache->max_uid = uidval; subparts = g_hash_table_lookup (cache->parts, uid); if (!subparts) { @@ -193,6 +198,17 @@ camel_imap_message_cache_new (const char *path, CamelFolderSummary *summary, return cache; } +/** + * camel_imap_message_cache_max_uid: + * @cache: the cache + * + * Return value: the largest (real) UID in the cache. + **/ +guint32 +camel_imap_message_cache_max_uid (CamelImapMessageCache *cache) +{ + return cache->max_uid; +} static void stream_finalize (CamelObject *stream, gpointer event_data, gpointer user_data) diff --git a/camel/providers/imap/camel-imap-message-cache.h b/camel/providers/imap/camel-imap-message-cache.h index c9af369a56..6ddf7339c7 100644 --- a/camel/providers/imap/camel-imap-message-cache.h +++ b/camel/providers/imap/camel-imap-message-cache.h @@ -47,6 +47,7 @@ struct _CamelImapMessageCache { char *path; GHashTable *parts, *cached; + guint32 max_uid; }; @@ -63,6 +64,8 @@ CamelImapMessageCache *camel_imap_message_cache_new (const char *path, CamelFolderSummary *summ, CamelException *ex); +guint32 camel_imap_message_cache_max_uid (CamelImapMessageCache *cache); + CamelStream *camel_imap_message_cache_insert (CamelImapMessageCache *cache, const char *uid, const char *part_spec, |