aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap
diff options
context:
space:
mode:
author0 <NotZed@Ximian.com>2001-10-30 15:55:59 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-30 15:55:59 +0800
commit4ae909c93b9ccea8f14df6aea16fc11323060f9f (patch)
tree1d88444d6b36e74126640748257331c4c9a7b0f9 /camel/providers/imap
parent4b3f1e83ea58731c3e0aa7172a86331efecbb867 (diff)
downloadgsoc2013-evolution-4ae909c93b9ccea8f14df6aea16fc11323060f9f.tar.gz
gsoc2013-evolution-4ae909c93b9ccea8f14df6aea16fc11323060f9f.tar.zst
gsoc2013-evolution-4ae909c93b9ccea8f14df6aea16fc11323060f9f.zip
If we can't retrieve the message, ignore it, it can't match.
2001-10-30 <NotZed@Ximian.com> * camel-folder-search.c (match_message): If we can't retrieve the message, ignore it, it can't match. * providers/imap/camel-imap-search.c (camel_imap_search_class_init): Setup parent class pointer. (imap_body_contains): If offline, just use the parent body_contains method which will get the messages and search them manually. * providers/imap/camel-imap-folder.c (imap_search_by_expression, imap_search_by_uids): Remove offline check. svn path=/trunk/; revision=14442
Diffstat (limited to 'camel/providers/imap')
-rw-r--r--camel/providers/imap/camel-imap-folder.c6
-rw-r--r--camel/providers/imap/camel-imap-search.c12
2 files changed, 8 insertions, 10 deletions
diff --git a/camel/providers/imap/camel-imap-folder.c b/camel/providers/imap/camel-imap-folder.c
index c525dedbda..67b515ec93 100644
--- a/camel/providers/imap/camel-imap-folder.c
+++ b/camel/providers/imap/camel-imap-folder.c
@@ -1305,9 +1305,6 @@ imap_search_by_expression (CamelFolder *folder, const char *expression, CamelExc
CamelImapFolder *imap_folder = CAMEL_IMAP_FOLDER (folder);
GPtrArray *matches, *summary;
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->parent_store), ex))
- return NULL;
-
/* we could get around this by creating a new search object each time,
but i doubt its worth it since any long operation would lock the
command channel too */
@@ -1335,9 +1332,6 @@ imap_search_by_uids(CamelFolder *folder, const char *expression, GPtrArray *uids
GPtrArray *summary, *matches;
int i;
- if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (folder->parent_store), ex))
- return NULL;
-
/* NOTE: could get away without the search lock by creating a new
search object each time */
diff --git a/camel/providers/imap/camel-imap-search.c b/camel/providers/imap/camel-imap-search.c
index 5e7b6d965f..2adaaef244 100644
--- a/camel/providers/imap/camel-imap-search.c
+++ b/camel/providers/imap/camel-imap-search.c
@@ -40,12 +40,16 @@ static ESExpResult *
imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv,
CamelFolderSearch *s);
+static CamelFolderSearchClass *imap_search_parent_class;
+
static void
camel_imap_search_class_init (CamelImapSearchClass *camel_imap_search_class)
{
/* virtual method overload */
CamelFolderSearchClass *camel_folder_search_class =
CAMEL_FOLDER_SEARCH_CLASS (camel_imap_search_class);
+
+ imap_search_parent_class = camel_type_get_global_classfuncs (camel_folder_search_get_type ());
/* virtual method overload */
camel_folder_search_class->body_contains = imap_body_contains;
@@ -99,6 +103,10 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv,
GPtrArray *sorted;
int i;
+ /* If offline, search using the parent class, which can handle this manually */
+ if (!camel_disco_store_check_online (CAMEL_DISCO_STORE (store), NULL))
+ return imap_search_parent_class->body_contains(f, argc, argv, s);
+
if (s->current) {
uid = camel_message_info_uid (s->current);
r = e_sexp_result_new (f, ESEXP_RES_BOOL);
@@ -111,8 +119,6 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv,
if (argc == 1 && *value == '\0' && s->folder) {
/* optimise the match "" case - match everything */
- int i;
-
r->value.ptrarray = g_ptr_array_new ();
for (i = 0; i < s->summary->len; i++) {
CamelMessageInfo *info = g_ptr_array_index (s->summary, i);
@@ -163,8 +169,6 @@ imap_body_contains (struct _ESExp *f, int argc, struct _ESExpResult **argv,
access to the summary memory which is locked for the duration of
the search, and wont vanish on us */
if (uid_hash == NULL) {
- int i;
-
uid_hash = g_hash_table_new (g_str_hash, g_str_equal);
for (i = 0; i < s->summary->len; i++) {
info = s->summary->pdata[i];