Added special case for no full text search support

pull/207/head
M66B 3 years ago
parent aa3f2ee50d
commit 9f779d3702

@ -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…
Cancel
Save