diff --git a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java index 761a81fb6b..a6b3d0f04d 100644 --- a/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java +++ b/app/src/main/java/eu/faircode/email/BoundaryCallbackMessages.java @@ -91,6 +91,7 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback msgnums = new ArrayList<>(); - for (Response response : responses) - if (((IMAPResponse) response).keyEquals("SEARCH")) { - int msgnum; - while ((msgnum = response.readNumber()) != -1) - msgnums.add(msgnum); - } - - EntityLog.log(context, "Search unicode messages=" + msgnums.size()); - Message[] imessages = new Message[msgnums.size()]; - for (int i = 0; i < msgnums.size(); i++) - imessages[i] = state.ifolder.getMessage(msgnums.get(i)); - - return imessages; + return search(true, browsable.keywords, protocol); } catch (Throwable ex) { - ProtocolException pex = new ProtocolException( - "Search unicode " + account.host + " " + criteria, ex); - EntityLog.log(context, pex.toString()); - //Log.e(pex); - // Fallback to ASCII search + EntityLog.log(context, ex.toString()); } - EntityLog.log(context, "Search ASCII"); - SearchTerm terms = criteria.getTerms( - false, - state.ifolder.getPermanentFlags(), - browsable.keywords); - if (terms == null) { - EntityLog.log(context, "Search ASCII no terms"); - return new Message[0]; - } - Message[] messages = state.ifolder.search(terms); - EntityLog.log(context, "Search ASCII" + - " messages=" + (messages == null ? null : messages.length)); - return messages; + return search(false, browsable.keywords, protocol); } } catch (Throwable ex) { ProtocolException pex = new ProtocolException( @@ -592,6 +542,45 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback