diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-12-01 18:41:32 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-12-01 18:41:32 +0000 |
commit | 95f30ecd1f90cd143c908589b600742148491c15 (patch) | |
tree | 8752ad58e1eae5963adc83093111a096cb76cf7f /synapse/api | |
parent | Merge pull request #400 from matrix-org/daniel/versioning (diff) | |
download | synapse-95f30ecd1f90cd143c908589b600742148491c15.tar.xz |
Add API for setting account_data globaly or on a per room basis
Diffstat (limited to 'synapse/api')
-rw-r--r-- | synapse/api/filtering.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/synapse/api/filtering.py b/synapse/api/filtering.py index 18f2ec3ae8..19f30c273c 100644 --- a/synapse/api/filtering.py +++ b/synapse/api/filtering.py @@ -50,7 +50,7 @@ class Filtering(object): # many definitions. top_level_definitions = [ - "presence" + "presence", "account_data" ] room_level_definitions = [ @@ -139,6 +139,10 @@ class FilterCollection(object): self.filter_json.get("presence", {}) ) + self.account_data = Filter( + self.filter_json.get("account_data", {}) + ) + def timeline_limit(self): return self.room_timeline_filter.limit() @@ -151,6 +155,9 @@ class FilterCollection(object): def filter_presence(self, events): return self.presence_filter.filter(events) + def filter_account_data(self, events): + return self.account_data.filter(events) + def filter_room_state(self, events): return self.room_state_filter.filter(events) |