Merge pull request #1127 from matrix-org/dbkr/publicroom_search_case_insensitive

Make public room search case insensitive
This commit is contained in:
Erik Johnston 2016-09-17 15:01:17 +01:00 committed by GitHub
commit e1ba98d724

View File

@ -361,12 +361,12 @@ class RoomListNextBatch(namedtuple("RoomListNextBatch", (
def _matches_room_entry(room_entry, search_filter):
if search_filter and search_filter.get("generic_search_term", None):
generic_search_term = search_filter["generic_search_term"]
if generic_search_term in room_entry.get("name", ""):
generic_search_term = search_filter["generic_search_term"].upper()
if generic_search_term in room_entry.get("name", "").upper():
return True
elif generic_search_term in room_entry.get("topic", ""):
elif generic_search_term in room_entry.get("topic", "").upper():
return True
elif generic_search_term in room_entry.get("canonical_alias", ""):
elif generic_search_term in room_entry.get("canonical_alias", "").upper():
return True
else:
return True