From 3fa2174b663cbc6d2e0469493420267ea424d9f0 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 14 Feb 2005 16:06:17 +0000 Subject: If we're in offline mode, let the parent implementation perform the 2005-02-10 Jeffrey Stedfast * camel-imap4-search.c (imap4_body_contains): If we're in offline mode, let the parent implementation perform the search. --- camel/providers/imap4/ChangeLog | 5 +++++ camel/providers/imap4/camel-imap4-search.c | 7 ++++++- camel/providers/imap4/camel-imap4-search.h | 14 ++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/camel/providers/imap4/ChangeLog b/camel/providers/imap4/ChangeLog index 725de4aaf..3da610806 100644 --- a/camel/providers/imap4/ChangeLog +++ b/camel/providers/imap4/ChangeLog @@ -1,3 +1,8 @@ +2005-02-10 Jeffrey Stedfast + + * camel-imap4-search.c (imap4_body_contains): If we're in offline + mode, let the parent implementation perform the search. + 2005-02-04 Not Zed * camel-imap4-store.c (imap4_build_folder_info): always get the diff --git a/camel/providers/imap4/camel-imap4-search.c b/camel/providers/imap4/camel-imap4-search.c index 7102e2fa0..fbfbe0276 100644 --- a/camel/providers/imap4/camel-imap4-search.c +++ b/camel/providers/imap4/camel-imap4-search.c @@ -29,6 +29,8 @@ #include #include +#include + #include "camel-imap4-command.h" #include "camel-imap4-engine.h" #include "camel-imap4-stream.h" @@ -123,7 +125,7 @@ untagged_search (CamelIMAP4Engine *engine, CamelIMAP4Command *ic, guint32 index, sprintf (uid, "%u", token->v.number); if ((info = camel_folder_summary_uid (summary, uid))) { g_ptr_array_add (matches, (char *) camel_message_info_uid (info)); - camel_message_info_free(info); + camel_message_info_free (info); } } @@ -153,6 +155,9 @@ imap4_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv, Cam size_t used; char *set; + if (((CamelOfflineStore *) engine->service)->state == CAMEL_OFFLINE_STORE_NETWORK_UNAVAIL) + return parent_class->body_contains (f, argc, argv, search); + summary_set = search->summary_set ? search->summary_set : search->summary; /* check the simple cases */ diff --git a/camel/providers/imap4/camel-imap4-search.h b/camel/providers/imap4/camel-imap4-search.h index 5165367cf..f9e9b29ee 100644 --- a/camel/providers/imap4/camel-imap4-search.h +++ b/camel/providers/imap4/camel-imap4-search.h @@ -1,6 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * Authors: Jeffrey Stedfast + * Michael Zucchi * * Copyright 2004 Novell, Inc. (www.novell.com) * @@ -24,6 +25,9 @@ #ifndef __CAMEL_IMAP4_SEARCH_H__ #define __CAMEL_IMAP4_SEARCH_H__ +#include + +#include #include #ifdef __cplusplus @@ -45,6 +49,16 @@ struct _CamelIMAP4Search { CamelFolderSearch parent_object; struct _CamelIMAP4Engine *engine; + + guint32 lastuid; /* current 'last uid' for the folder */ + guint32 validity; /* validity of the current folder */ + + CamelDataCache *cache; /* disk-cache for searches */ + + /* cache of body search matches */ + EDList matches; + GHashTable *matches_hash; + unsigned int matches_count; }; struct _CamelIMAP4SearchClass { -- cgit v1.2.1