mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-23 10:20:25 +01:00
Fix case-insensitive queries for groups with non-ASCII characters.
Fixes #11464
This commit is contained in:
committed by
Cody Henthorne
parent
77ea2deada
commit
14849d6e45
@@ -281,16 +281,18 @@ private static final String[] GROUP_PROJECTION = {
|
||||
return noMetadata && noMembers;
|
||||
}
|
||||
|
||||
public Reader getGroupsFilteredByTitle(String constraint, boolean includeInactive, boolean excludeV1, boolean excludeMms) {
|
||||
public Reader queryGroupsByTitle(String inputQuery, boolean includeInactive, boolean excludeV1, boolean excludeMms) {
|
||||
String query;
|
||||
String[] queryArgs;
|
||||
|
||||
String caseInsensitiveQuery = SqlUtil.buildCaseInsensitiveGlobPattern(inputQuery);
|
||||
|
||||
if (includeInactive) {
|
||||
query = TITLE + " LIKE ? AND (" + ACTIVE + " = ? OR " + RECIPIENT_ID + " IN (SELECT " + ThreadDatabase.RECIPIENT_ID + " FROM " + ThreadDatabase.TABLE_NAME + "))";
|
||||
queryArgs = new String[]{"%" + constraint + "%", "1"};
|
||||
query = TITLE + " GLOB ? AND (" + ACTIVE + " = ? OR " + RECIPIENT_ID + " IN (SELECT " + ThreadDatabase.RECIPIENT_ID + " FROM " + ThreadDatabase.TABLE_NAME + "))";
|
||||
queryArgs = SqlUtil.buildArgs(caseInsensitiveQuery, 1);
|
||||
} else {
|
||||
query = TITLE + " LIKE ? AND " + ACTIVE + " = ?";
|
||||
queryArgs = new String[]{"%" + constraint + "%", "1"};
|
||||
query = TITLE + " GLOB ? AND " + ACTIVE + " = ?";
|
||||
queryArgs = SqlUtil.buildArgs(caseInsensitiveQuery, 1);
|
||||
}
|
||||
|
||||
if (excludeV1) {
|
||||
|
||||
Reference in New Issue
Block a user