mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +01:00
Fix crash when adding person to an existing mms group.
This commit is contained in:
@@ -241,7 +241,7 @@ private static final String[] GROUP_PROJECTION = {
|
||||
return noMetadata && noMembers;
|
||||
}
|
||||
|
||||
public Reader getGroupsFilteredByTitle(String constraint, boolean includeInactive, boolean excludeV1) {
|
||||
public Reader getGroupsFilteredByTitle(String constraint, boolean includeInactive, boolean excludeV1, boolean excludeMms) {
|
||||
String query;
|
||||
String[] queryArgs;
|
||||
|
||||
@@ -257,6 +257,10 @@ private static final String[] GROUP_PROJECTION = {
|
||||
query += " AND " + EXPECTED_V2_ID + " IS NULL";
|
||||
}
|
||||
|
||||
if (excludeMms) {
|
||||
query += " AND " + MMS + " = 0";
|
||||
}
|
||||
|
||||
Cursor cursor = databaseHelper.getReadableDatabase().query(TABLE_NAME, null, query, queryArgs, null, null, TITLE + " COLLATE NOCASE ASC");
|
||||
|
||||
return new Reader(cursor);
|
||||
|
||||
@@ -543,7 +543,8 @@ public class ThreadDatabase extends Database {
|
||||
}
|
||||
|
||||
if (hideSms) {
|
||||
query += " AND (" + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.GROUP_ID + " NOT NULL OR " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.REGISTERED + " = " + RecipientDatabase.RegisteredState.REGISTERED.getId() + ")";
|
||||
query += " AND ((" + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.GROUP_ID + " NOT NULL AND " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.GROUP_TYPE + " != " + RecipientDatabase.GroupType.MMS.getId() + ")" +
|
||||
" OR " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.REGISTERED + " = " + RecipientDatabase.RegisteredState.REGISTERED.getId() + ")";
|
||||
query += " AND " + RecipientDatabase.TABLE_NAME + "." + RecipientDatabase.FORCE_SMS_SELECTION + " = 0";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user