Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d7032868 authored by cketti's avatar cketti
Browse files

Make LocalStore.searchForMessages() skip empty messages

parent 613ef6ce
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -976,8 +976,10 @@ public class LocalStore extends Store implements Serializable {
        }

        // build sql query
        String sqlQuery = "SELECT " + GET_MESSAGES_COLS + "FROM messages WHERE deleted = 0 "
                        + (search.getConditions() != null ? "AND (" + search.getConditions() + ")" : "") + " ORDER BY date DESC";
        ConditionsTreeNode conditions = search.getConditions();
        String sqlQuery = "SELECT " + GET_MESSAGES_COLS + "FROM messages WHERE " +
                "((empty IS NULL OR empty != 1) AND deleted = 0)" +
                ((conditions != null) ? " AND (" + conditions + ")" : "") + " ORDER BY date DESC";

        if (K9.DEBUG) {
            Log.d(K9.LOG_TAG, "Query = " + sqlQuery);