revert last commit, it's not needed
[claws.git] / src / imap.c
index cdf15378dd380ce3f8bb4c5609bc09ec97a30e18..5ec34866d5d7efac7ce6aad46d306500f3f22467 100644 (file)
@@ -2498,11 +2498,15 @@ static gint     search_msgs             (Folder                 *folder,
        if (result == MAILIMAP_ERROR_PROTOCOL) {
                debug_print("Server side search unavailable, using local search\n");
                imap_handle_error(SESSION(session), NULL, result);
-               return folder_item_search_msgs_local(folder, container, msgs, NULL,
-                                                      predicate, progress_cb, progress_data);
-       } 
-       
-       if (result == MAILIMAP_NO_ERROR) {
+               result = folder_item_search_msgs_local(folder, container, msgs,                             NULL, predicate, progress_cb, progress_data);
+               if (result < 0) {
+                       debug_print("search_msgs - got protocol error, aborting\n");
+                       alertpanel_error_log(_("Search failed due to server error."));
+                       return -1;
+               }
+
+               return result;
+       } if (result == MAILIMAP_NO_ERROR) {
                gint result = 0;
 
                *msgs = imap_uid_list_from_lep(uidlist, &result);