diff options
author | Mark Haines <mjark@negativecurvature.net> | 2016-05-13 11:30:22 +0100 |
---|---|---|
committer | Mark Haines <mjark@negativecurvature.net> | 2016-05-13 11:30:22 +0100 |
commit | 048b3ece36ed133365ab430d5a332ba2a72d7af5 (patch) | |
tree | 4ea9951d37367a8828d3fb28ccbadb599e6beba1 /synapse/handlers/search.py | |
parent | Merge pull request #776 from matrix-org/markjh/lazy_signing_key (diff) | |
parent | missed a spot (diff) | |
download | synapse-048b3ece36ed133365ab430d5a332ba2a72d7af5.tar.xz |
Merge pull request #777 from matrix-org/markjh/move_filter_for_client
move filter_events_for_client out of base handler
Diffstat (limited to 'synapse/handlers/search.py')
-rw-r--r-- | synapse/handlers/search.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/synapse/handlers/search.py b/synapse/handlers/search.py index a937e87408..df75d70fac 100644 --- a/synapse/handlers/search.py +++ b/synapse/handlers/search.py @@ -21,6 +21,7 @@ from synapse.api.constants import Membership, EventTypes from synapse.api.filtering import Filter from synapse.api.errors import SynapseError from synapse.events.utils import serialize_event +from synapse.visibility import filter_events_for_client from unpaddedbase64 import decode_base64, encode_base64 @@ -172,8 +173,8 @@ class SearchHandler(BaseHandler): filtered_events = search_filter.filter([r["event"] for r in results]) - events = yield self.filter_events_for_client( - user.to_string(), filtered_events + events = yield filter_events_for_client( + self.store, user.to_string(), filtered_events ) events.sort(key=lambda e: -rank_map[e.event_id]) @@ -223,8 +224,8 @@ class SearchHandler(BaseHandler): r["event"] for r in results ]) - events = yield self.filter_events_for_client( - user.to_string(), filtered_events + events = yield filter_events_for_client( + self.store, user.to_string(), filtered_events ) room_events.extend(events) @@ -281,12 +282,12 @@ class SearchHandler(BaseHandler): event.room_id, event.event_id, before_limit, after_limit ) - res["events_before"] = yield self.filter_events_for_client( - user.to_string(), res["events_before"] + res["events_before"] = yield filter_events_for_client( + self.store, user.to_string(), res["events_before"] ) - res["events_after"] = yield self.filter_events_for_client( - user.to_string(), res["events_after"] + res["events_after"] = yield filter_events_for_client( + self.store, user.to_string(), res["events_after"] ) res["start"] = now_token.copy_and_replace( |