From 4ae909c93b9ccea8f14df6aea16fc11323060f9f Mon Sep 17 00:00:00 2001 From: 0 Date: Tue, 30 Oct 2001 07:55:59 +0000 Subject: If we can't retrieve the message, ignore it, it can't match. 2001-10-30 * 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 --- camel/providers/imap/camel-imap-search.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'camel/providers/imap/camel-imap-search.c') 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]; -- cgit v1.2.3