0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-16 06:51:46 +01:00

Merge pull request #6268 from matrix-org/erikj/case_insensitive_room_dir

Make room directory search case insensitive
This commit is contained in:
Erik Johnston 2019-10-29 12:41:11 +01:00 committed by GitHub
commit 1652c8c1fc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 5 deletions

1
changelog.d/6286.bugfix Normal file
View file

@ -0,0 +1 @@
Fix bug where room directory search was case sensitive.

View file

@ -201,13 +201,17 @@ class RoomWorkerStore(SQLBaseStore):
where_clauses.append(
"""
(
name LIKE ?
OR topic LIKE ?
OR canonical_alias LIKE ?
LOWER(name) LIKE ?
OR LOWER(topic) LIKE ?
OR LOWER(canonical_alias) LIKE ?
)
"""
)
query_args += [search_term, search_term, search_term]
query_args += [
search_term.lower(),
search_term.lower(),
search_term.lower(),
]
where_clause = ""
if where_clauses:

View file

@ -114,7 +114,7 @@ skip_install = True
basepython = python3.6
deps =
flake8
black
black==19.3b0 # We pin so that our tests don't start failing on new releases of black.
commands =
python -m black --check --diff .
/bin/sh -c "flake8 synapse tests scripts scripts-dev scripts/hash_password scripts/register_new_matrix_user scripts/synapse_port_db synctl {env:PEP8SUFFIX:}"