summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-29 10:24:02 +0000
committerErik Johnston <erik@matrix.org>2019-10-29 10:24:02 +0000
commit342d871d767f029f4ee8d8901cc2ea69db6a8d1d (patch)
tree553fe16c3d3293ef06717ba00c3e4264c6fe4162 /synapse
parent1.5.0rc2 (diff)
downloadsynapse-342d871d767f029f4ee8d8901cc2ea69db6a8d1d.tar.xz
Make room directory search case insensitive
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/data_stores/main/room.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/synapse/storage/data_stores/main/room.py b/synapse/storage/data_stores/main/room.py
index 4428e5c55d..67bb1b6f60 100644
--- a/synapse/storage/data_stores/main/room.py
+++ b/synapse/storage/data_stores/main/room.py
@@ -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: