mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-15 00:21:10 +00:00
Added special case for no full text search support
This commit is contained in:
parent
aa3f2ee50d
commit
9f779d3702
2 changed files with 13 additions and 0 deletions
|
@ -107,6 +107,8 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
|||
|
||||
void onLoaded(int found);
|
||||
|
||||
void onWarning(String message);
|
||||
|
||||
void onException(@NonNull Throwable ex);
|
||||
}
|
||||
|
||||
|
@ -590,6 +592,12 @@ 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")) {
|
||||
intf.onWarning(context.getString(R.string.title_service_auth, ex.toString()));
|
||||
criteria.in_message = false;
|
||||
}
|
||||
}
|
||||
|
||||
return search(false, browsable.keywords, protocol, state);
|
||||
|
|
|
@ -5788,6 +5788,11 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
updateListState("Loaded found=" + found, SimpleTask.getCount(), adapter == null ? 0 : adapter.getItemCount() + found);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarning(String message) {
|
||||
ToastEx.makeText(getContext(), message, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onException(@NonNull Throwable ex) {
|
||||
if (getLifecycle().getCurrentState().isAtLeast(Lifecycle.State.STARTED))
|
||||
|
|
Loading…
Add table
Reference in a new issue