mirror of https://github.com/M66B/FairEmail.git
Auto retry search without keywords
This commit is contained in:
parent
d128c9284a
commit
1fe67df028
|
@ -509,11 +509,25 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
return search(true, browsable.keywords, protocol, state);
|
||||
} catch (Throwable ex) {
|
||||
EntityLog.log(context, ex.toString());
|
||||
if (ex instanceof ProtocolException &&
|
||||
ex.getMessage() != null &&
|
||||
ex.getMessage().contains("full text search not supported")) {
|
||||
if (ex instanceof ProtocolException && ex.getMessage() != null)
|
||||
try {
|
||||
boolean retry = false;
|
||||
String remark = null;
|
||||
if (ex.getMessage().contains("full text search not supported")) {
|
||||
retry = true;
|
||||
criteria.in_message = false;
|
||||
} else if (ex.getMessage().contains("invalid search criteria")) {
|
||||
// invalid SEARCH command syntax, invalid search criteria syntax
|
||||
retry = true;
|
||||
criteria.in_keywords = false;
|
||||
remark = "Keyword search not supported?";
|
||||
}
|
||||
|
||||
if (retry) {
|
||||
String msg = context.getString(R.string.title_service_auth,
|
||||
account.host + ": " + getMessage(ex));
|
||||
account.host + ": " +
|
||||
(remark == null ? "" : remark + " - ") +
|
||||
getMessage(ex));
|
||||
ApplicationEx.getMainHandler().post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
@ -521,7 +535,11 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
intf.onWarning(msg);
|
||||
}
|
||||
});
|
||||
criteria.in_message = false;
|
||||
|
||||
return search(true, browsable.keywords, protocol, state);
|
||||
}
|
||||
} catch (Throwable exex) {
|
||||
Log.w(exex);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue