remove wonky style
[claws.git] / src / imap.c
index 8d8876b7245ef4137f2e7f66ea5c478141108320..3ab83c50f109a2ec6e0f87dc46338700080e4fc0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2016 Hiroyuki Yamamoto and the Claws Mail team
+ * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -2496,11 +2496,20 @@ static gint     search_msgs             (Folder                 *folder,
                progress_cb(progress_data, TRUE, container->total_msgs, 0, container->total_msgs);
 
        if (result == MAILIMAP_ERROR_PROTOCOL) {
-               debug_print("search_msgs - got protocol error, aborting\n");
+               debug_print("Server side search unavailable, using local search\n");
                imap_handle_error(SESSION(session), NULL, result);
-               alertpanel_error_log(_("Search failed due to server error."));
-               return -1;
-       } 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);