Fix search

This commit is contained in:
tom79 2019-08-19 16:33:09 +02:00
parent 4c550ea3b0
commit 2df5b95112
2 changed files with 3 additions and 3 deletions

View File

@ -348,13 +348,15 @@ public class RetrieveFeedsAsyncTask extends AsyncTask<Void, Void, Void> {
if( statuses != null){
statusesNew = new ArrayList<>();
for(app.fedilab.android.client.Entities.Status status: statuses){
if (tag != null) {
if (tag != null && !tag.contains("\"")) {
String[] searches = tag.split(" ");
for (String search : searches) {
if (status.getContent().contains(search) || status.getSpoiler_text().contains(search)) {
statusesNew.add(status);
}
}
}else{
statusesNew.addAll(statuses);
}
}
}

View File

@ -19,7 +19,6 @@ import android.content.Context;
import android.content.SharedPreferences;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
@ -167,7 +166,6 @@ public class TimelineCacheDAO {
String search = word.replace("\"","");
query = new StringBuilder(Sqlite.COL_CACHE + " LIKE '%").append(search).append("%'");
}
if (max_id != null) {
c = db.query(Sqlite.TABLE_TIMELINE_CACHE, null, Sqlite.COL_INSTANCE + " = \"" + instance + "\" AND " + Sqlite.COL_USER_ID + " = \"" + userId + "\" AND " + Sqlite.COL_STATUS_ID + " < '" + max_id + "' AND " + query, null, null, null, Sqlite.COL_STATUS_ID + " DESC", "40");
return cursorToListStatus(c);