1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-24 02:12:15 -05:00

Make LocalStore.searchForMessages() skip empty messages

This commit is contained in:
cketti 2012-10-24 06:01:26 +02:00
parent 613ef6ced2
commit d703286833

View File

@ -976,8 +976,10 @@ public class LocalStore extends Store implements Serializable {
} }
// build sql query // build sql query
String sqlQuery = "SELECT " + GET_MESSAGES_COLS + "FROM messages WHERE deleted = 0 " ConditionsTreeNode conditions = search.getConditions();
+ (search.getConditions() != null ? "AND (" + search.getConditions() + ")" : "") + " ORDER BY date DESC"; 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) { if (K9.DEBUG) {
Log.d(K9.LOG_TAG, "Query = " + sqlQuery); Log.d(K9.LOG_TAG, "Query = " + sqlQuery);