Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge pull request #6268 from matrix-org/erikj/case_insensitive_room_dir
Browse files Browse the repository at this point in the history
* commit '1652c8c1f':
  Add comment as to why we're pinning black in tests
  Pin black version
  Newsfile
  Make room directory search case insensitive
  • Loading branch information
anoadragon453 committed Mar 16, 2020
2 parents 3ac38d4 + 1652c8c commit f39a917
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions changelog.d/6286.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix bug where room directory search was case sensitive.
12 changes: 8 additions & 4 deletions synapse/storage/data_stores/main/room.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,17 @@ def get_largest_public_rooms(
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:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ skip_install = True
basepython = python3.6
deps =
flake8
black==19.3b0
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:}"
Expand Down

0 comments on commit f39a917

Please sign in to comment.