mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 02:10:44 +01:00
Show recent groups in Add to Groups screen.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user