Show recent groups in Add to Groups screen.

This commit is contained in:
Cody Henthorne
2020-06-09 12:13:13 -04:00
committed by GitHub
parent dc46d88ddd
commit 2822042eeb
3 changed files with 30 additions and 2 deletions

View File

@@ -442,9 +442,18 @@ public class ThreadDatabase extends Database {
}
public Cursor getRecentConversationList(int limit, boolean includeInactiveGroups) {
return getRecentConversationList(limit, includeInactiveGroups, false);
}
public Cursor getRecentConversationList(int limit, boolean includeInactiveGroups, boolean groupsOnly) {
SQLiteDatabase db = databaseHelper.getReadableDatabase();
String query = !includeInactiveGroups ? MESSAGE_COUNT + " != 0 AND (" + GroupDatabase.TABLE_NAME + "." + GroupDatabase.ACTIVE + " IS NULL OR " + GroupDatabase.TABLE_NAME + "." + GroupDatabase.ACTIVE + " = 1)"
: MESSAGE_COUNT + " != 0";
if (groupsOnly) {
query += " AND " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.GROUP_ID + " NOT NULL";
}
return db.rawQuery(createQuery(query, limit), null);
}