diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-01-25 10:49:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-25 10:49:58 +0000 |
commit | b1b6dba2d2c0690157cdd620063d4e16a583264a (patch) | |
tree | 2a5f4a1d51dced1405e08b17f0dcd5fb669b0a65 /synapse/api | |
parent | Merge pull request #4447 from matrix-org/erikj/msc_1813 (diff) | |
parent | Merge branch 'anoa/full_search_upgraded_rooms' of github.com:matrix-org/synap... (diff) | |
download | synapse-b1b6dba2d2c0690157cdd620063d4e16a583264a.tar.xz |
Merge pull request #4415 from matrix-org/anoa/full_search_upgraded_rooms
Ability to search entire room history after upgrading room
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/filtering.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py index 16ad654864..3906475403 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py @@ -444,6 +444,20 @@ class Filter(object): def include_redundant_members(self): return self.filter_json.get("include_redundant_members", False) + def with_room_ids(self, room_ids): + """Returns a new filter with the given room IDs appended. + + Args: + room_ids (iterable[unicode]): The room_ids to add + + Returns: + filter: A new filter including the given rooms and the old + filter's rooms. + """ + newFilter = Filter(self.filter_json) + newFilter.rooms += room_ids + return newFilter + def _matches_wildcard(actual_value, filter_value): if filter_value.endswith("*"): |