summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@novell.com>2005-02-14 16:06:17 +0000
committerJeffrey Stedfast <fejj@src.gnome.org>2005-02-14 16:06:17 +0000
commit3fa2174b663cbc6d2e0469493420267ea424d9f0 (patch)
tree7a9273f04d73a6f7551fc3be50cf8ae6d8870fbe
parentdf7f6d535a58abe66dae4dd4a399aeae2474cf94 (diff)
downloadevolution-data-server-3fa2174b663cbc6d2e0469493420267ea424d9f0.tar.gz
If we're in offline mode, let the parent implementation perform the
2005-02-10 Jeffrey Stedfast <fejj@novell.com> * camel-imap4-search.c (imap4_body_contains): If we're in offline mode, let the parent implementation perform the search.
-rw-r--r--camel/providers/imap4/ChangeLog5
-rw-r--r--camel/providers/imap4/camel-imap4-search.c7
-rw-r--r--camel/providers/imap4/camel-imap4-search.h14
3 files changed, 25 insertions, 1 deletions
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 <fejj@novell.com>
+
+ * 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 <NotZed@Ximian.com>
* 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 <string.h>
#include <ctype.h>
+#include <camel/camel-offline-store.h>
+
#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 <fejj@novell.com>
+ * Michael Zucchi <notzed@novell.com>
*
* Copyright 2004 Novell, Inc. (www.novell.com)
*
@@ -24,6 +25,9 @@
#ifndef __CAMEL_IMAP4_SEARCH_H__
#define __CAMEL_IMAP4_SEARCH_H__
+#include <libedataserver/e-msgport.h>
+
+#include <camel/camel-data-cache.h>
#include <camel/camel-folder-search.h>
#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 {