2012-09-28 [colin] 3.8.1cvs81
authorColin Leroy <colin@colino.net>
Fri, 28 Sep 2012 15:33:05 +0000 (15:33 +0000)
committerColin Leroy <colin@colino.net>
Fri, 28 Sep 2012 15:33:05 +0000 (15:33 +0000)
* src/advsearch.c
Never search on server if we're offline
(Asking the user would and will be better)
* src/imap.c
Fix uninitialized variable (bogus) warning
Fix SELECT of the folder before searching

ChangeLog
PATCHSETS
configure.ac
src/advsearch.c
src/imap.c

index 1969f5b..a008ab3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-28 [colin]     3.8.1cvs81
+
+       * src/advsearch.c
+               Never search on server if we're offline
+               (Asking the user would and will be better)
+       * src/imap.c
+               Fix uninitialized variable (bogus) warning
+               Fix SELECT of the folder before searching
+
 2012-09-27 [colin]     3.8.1cvs80
 
        * src/advsearch.c
index c886b5d..d442aff 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.75.2.76 -r 1.75.2.77 src/matcher.c;  cvs diff -u -r 1.49.2.151 -r 1.49.2.152 src/procmime.c;  cvs diff -u -r 1.17.2.30 -r 1.17.2.31 src/procmime.h;  ) > 3.8.1cvs78.patchset
 ( cvs diff -u -r 1.115.2.258 -r 1.115.2.259 src/main.c;  cvs diff -u -r 1.75.2.77 -r 1.75.2.78 src/matcher.c;  cvs diff -u -r 1.39.2.22 -r 1.39.2.23 src/matcher.h;  cvs diff -u -r 1.15.2.73 -r 1.15.2.74 src/summary_search.c;  ) > 3.8.1cvs79.patchset
 ( cvs diff -u -r 1.1.2.3 -r 1.1.2.4 src/advsearch.c;  cvs diff -u -r 1.179.2.264 -r 1.179.2.265 src/imap.c;  cvs diff -u -r 1.1.4.121 -r 1.1.4.122 src/etpan/imap-thread.c;  cvs diff -u -r 1.1.4.29 -r 1.1.4.30 src/etpan/imap-thread.h;  ) > 3.8.1cvs80.patchset
+( cvs diff -u -r 1.1.2.4 -r 1.1.2.5 src/advsearch.c;  cvs diff -u -r 1.179.2.265 -r 1.179.2.266 src/imap.c;  ) > 3.8.1cvs81.patchset
index c6e4540..21612c3 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=80
+EXTRA_VERSION=81
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 686e241..7c36e2c 100644 (file)
@@ -30,6 +30,7 @@
 #include "matcher.h"
 #include "matcher_parser.h"
 #include "utils.h"
+#include "prefs_common.h"
 
 struct _AdvancedSearch {
        struct {
@@ -487,9 +488,12 @@ static gboolean search_impl(MsgInfoList **messages, AdvancedSearch* search,
                MsgNumberList *msgnums = NULL;
                MsgNumberList *cur;
                MsgInfoList *msgs = NULL;
+               gboolean can_search_on_server = 
+                               folderItem->folder->klass->supports_server_search 
+                               && !prefs_common.work_offline;
 
                if (!search_filter_folder(&msgnums, search, folderItem,
-                                       folderItem->folder->klass->supports_server_search)) {
+                                         can_search_on_server)) {
                        g_slist_free(msgnums);
                        return FALSE;
                }
index 6a959be..2f1a287 100644 (file)
@@ -2167,7 +2167,8 @@ static gint       search_msgs             (Folder                 *folder,
        GSList* cur;
        int result = -1;
        clist* uidlist = NULL;
-       gboolean server_filtering_useless;
+       gboolean server_filtering_useless = FALSE;
+        IMAPSession *session;
 
        if (on_server == NULL || !*on_server) {
                return folder_item_search_msgs_local(folder, container, msgs, on_server,
@@ -2221,6 +2222,15 @@ static gint      search_msgs             (Folder                 *folder,
                return count;
        }
 
+       session = imap_session_get(folder);
+        if (!session) {
+                return -1;
+        }
+       result = imap_select(session, IMAP_FOLDER(folder), FOLDER_ITEM(container),
+                        NULL, NULL, NULL, NULL, NULL, TRUE);
+       if (result != MAILIMAP_NO_ERROR)
+               return -1;
+
        if (progress_cb)
                progress_cb(progress_data, TRUE, 0, 0, container->total_msgs);
        result = imap_threaded_search(folder, IMAP_SEARCH_TYPE_KEYED, key, NULL, &uidlist);