2006-06-19 [colin] 2.3.0cvs24
authorColin Leroy <colin@colino.net>
Mon, 19 Jun 2006 19:46:21 +0000 (19:46 +0000)
committerColin Leroy <colin@colino.net>
Mon, 19 Jun 2006 19:46:21 +0000 (19:46 +0000)
* src/imap.c
* src/etpan/imap-thread.c
Workaround Rockliffe IMAP server bug: replace
"x UID SEARCH (ANSWERED UID 1:*)" with
"x UID SEARCH ANSWERED"
(Rockliffe doesn't handle the parenthesis)

ChangeLog
PATCHSETS
configure.ac
src/etpan/imap-thread.c
src/imap.c

index ae12fe9..470e654 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-06-19 [colin]     2.3.0cvs24
+
+       * src/imap.c
+       * src/etpan/imap-thread.c
+               Workaround Rockliffe IMAP server bug: replace
+               "x UID SEARCH (ANSWERED UID 1:*)" with
+               "x UID SEARCH ANSWERED"
+               (Rockliffe doesn't handle the parenthesis)
+
 2006-06-19 [colin]     2.3.0cvs23
 
        * src/compose.c
index c62b070..f1ddc28 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.16.2.19 -r 1.16.2.20 src/prefs_customheader.c;  ) > 2.3.0cvs21.patchset
 ( cvs diff -u -r 1.16.2.20 -r 1.16.2.21 src/prefs_customheader.c;  ) > 2.3.0cvs22.patchset
 ( cvs diff -u -r 1.382.2.279 -r 1.382.2.280 src/compose.c;  cvs diff -u -r 1.179.2.120 -r 1.179.2.121 src/imap.c;  cvs diff -u -r 1.9.2.25 -r 1.9.2.26 src/common/defs.h;  cvs diff -u -r 1.1.4.40 -r 1.1.4.41 src/etpan/imap-thread.c;  ) > 2.3.0cvs23.patchset
+( cvs diff -u -r 1.179.2.121 -r 1.179.2.122 src/imap.c;  cvs diff -u -r 1.1.4.41 -r 1.1.4.42 src/etpan/imap-thread.c;  ) > 2.3.0cvs24.patchset
index de3365e..aefe7a0 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=3
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=23
+EXTRA_VERSION=24
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index f3d0d19..bbba767 100644 (file)
@@ -1137,14 +1137,19 @@ static void search_run(struct etpan_thread_op * op)
        struct search_result * result;
        int r;
        struct mailimap_search_key * key;
-       struct mailimap_search_key * uid_key;
+       struct mailimap_search_key * uid_key = NULL;
        struct mailimap_search_key * search_type_key;
        clist * search_result;
        
        param = op->param;
        
+       if (param->set == NULL && param->type == IMAP_SEARCH_TYPE_SIMPLE) {
+               g_warning("broken search");
+       }
+       
        /* we copy the mailimap_set because freeing the key is recursive */
-       uid_key = mailimap_search_key_new_uid(sc_mailimap_set_copy(param->set));
+       if (param->set != NULL)
+               uid_key = mailimap_search_key_new_uid(sc_mailimap_set_copy(param->set));
        
        search_type_key = NULL;
        switch (param->type) {
@@ -1198,22 +1203,33 @@ static void search_run(struct etpan_thread_op * op)
        }
        
        if (search_type_key != NULL) {
-               key = mailimap_search_key_new_multiple_empty();
-               mailimap_search_key_multiple_add(key, search_type_key);
-               mailimap_search_key_multiple_add(key, uid_key);
+               if (param->set != NULL) {
+                       key = mailimap_search_key_new_multiple_empty();
+                       mailimap_search_key_multiple_add(key, search_type_key);
+                       mailimap_search_key_multiple_add(key, uid_key);
+               } else {
+                       key = search_type_key;
+               }
        }
-       else {
+       else if (uid_key != NULL) {
                key = uid_key;
        }
        
-       r = mailimap_uid_search(param->imap, NULL, key, &search_result);
-       
-       /* free the key (with the imapset) */
-       mailimap_search_key_free(key);
+       if (key == NULL) {
+               g_warning("no key!");
+               result = op->result;
+               result->error = -1;
+               result->search_result = NULL;
+       } else {
+               r = mailimap_uid_search(param->imap, NULL, key, &search_result);
 
-       result = op->result;
-       result->error = r;
-       result->search_result = search_result;
+               /* free the key (with the imapset) */
+               mailimap_search_key_free(key);
+
+               result = op->result;
+               result->error = r;
+               result->search_result = search_result;
+       }
        debug_print("imap search run - end %i\n", r);
 }
 
index fb7c845..8cc02a9 100644 (file)
@@ -3689,12 +3689,12 @@ static /*gint*/ void *imap_get_flags_thread(void *data)
                imapset = cur->data;
                if (reverse_seen) {
                        r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_SEEN,
-                                                imapset, &lep_uidlist);
+                                                full_search ? NULL:imapset, &lep_uidlist);
                }
                else {
                        r = imap_threaded_search(folder,
                                                 IMAP_SEARCH_TYPE_UNSEEN,
-                                                imapset, &lep_uidlist);
+                                                full_search ? NULL:imapset, &lep_uidlist);
                }
                if (r == MAILIMAP_NO_ERROR) {
                        GSList * uidlist;
@@ -3706,7 +3706,7 @@ static /*gint*/ void *imap_get_flags_thread(void *data)
                }
                
                r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_FLAGGED,
-                                        imapset, &lep_uidlist);
+                                        full_search ? NULL:imapset, &lep_uidlist);
                if (r == MAILIMAP_NO_ERROR) {
                        GSList * uidlist;
 
@@ -3718,7 +3718,7 @@ static /*gint*/ void *imap_get_flags_thread(void *data)
 
                if (item->opened || item->processing_pending || item == folder->inbox) {
                        r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_ANSWERED,
-                                                imapset, &lep_uidlist);
+                                                full_search ? NULL:imapset, &lep_uidlist);
                        if (r == MAILIMAP_NO_ERROR) {
                                GSList * uidlist;
 
@@ -3729,7 +3729,7 @@ static /*gint*/ void *imap_get_flags_thread(void *data)
                        }
 
                        r = imap_threaded_search(folder, IMAP_SEARCH_TYPE_DELETED,
-                                                imapset, &lep_uidlist);
+                                                full_search ? NULL:imapset, &lep_uidlist);
                        if (r == MAILIMAP_NO_ERROR) {
                                GSList * uidlist;