Merge pull request #1583 from vector-im/feature/fix_search_case

Fixes #1468 user search case
This commit is contained in:
Benoit Marty 2020-06-30 19:16:48 +02:00 committed by GitHub
commit 73ce38c6a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -20,6 +20,7 @@ Bugfix 🐛:
- User could not redact message that they have sent (#1543)
- Use vendor prefix for non merged MSC (#1537)
- Compress images before sending (#1333)
- Searching by displayname is case sensitive (#1468)
Translations 🗣:
-

View file

@ -33,6 +33,7 @@ import im.vector.matrix.android.internal.database.model.UserEntityFields
import im.vector.matrix.android.internal.database.query.where
import im.vector.matrix.android.internal.di.SessionDatabase
import im.vector.matrix.android.internal.util.fetchCopied
import io.realm.Case
import javax.inject.Inject
internal class UserDataSource @Inject constructor(@SessionDatabase private val monarchy: Monarchy) {
@ -91,7 +92,7 @@ internal class UserDataSource @Inject constructor(@SessionDatabase private val m
} else {
query
.beginGroup()
.contains(UserEntityFields.DISPLAY_NAME, filter)
.contains(UserEntityFields.DISPLAY_NAME, filter, Case.INSENSITIVE)
.or()
.contains(UserEntityFields.USER_ID, filter)
.endGroup()