summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <daniel@matrix.org>2016-01-20 15:34:07 +0000
committerreview.rocks <nobody@review.rocks>2016-01-20 15:34:07 +0000
commitda417aa56d3582ab91805b1a623c18691995a3e6 (patch)
treee0352a71a18f9ab5cdd52aa3e49d9cfcfd99c87d /synapse/handlers/_base.py
parentMerge branch 'dbkr/no_push_for_own_events' into develop (diff)
downloadsynapse-da417aa56d3582ab91805b1a623c18691995a3e6.tar.xz
Allow non-guests to peek on rooms using /events
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 46abb8ec51..744a9ee507 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -84,7 +84,7 @@ class BaseHandler(object):
             row["event_id"] for rows in forgotten for row in rows
         )
 
-        def allowed(event, user_id, is_guest):
+        def allowed(event, user_id, is_peeking):
             state = event_id_to_state[event.event_id]
 
             visibility_event = state.get((EventTypes.RoomHistoryVisibility, ""), None)
@@ -96,7 +96,7 @@ class BaseHandler(object):
             if visibility == "world_readable":
                 return True
 
-            if is_guest:
+            if is_peeking:
                 return False
 
             membership_event = state.get((EventTypes.Member, user_id), None)
@@ -112,7 +112,7 @@ class BaseHandler(object):
                 return True
 
             if event.type == EventTypes.RoomHistoryVisibility:
-                return not is_guest
+                return not is_peeking
 
             if visibility == "shared":
                 return True
@@ -127,15 +127,15 @@ class BaseHandler(object):
             user_id: [
                 event
                 for event in events
-                if allowed(event, user_id, is_guest)
+                if allowed(event, user_id, is_peeking)
             ]
-            for user_id, is_guest in user_tuples
+            for user_id, is_peeking in user_tuples
         })
 
     @defer.inlineCallbacks
-    def _filter_events_for_client(self, user_id, events, is_guest=False):
+    def _filter_events_for_client(self, user_id, events, is_peeking=False):
         # Assumes that user has at some point joined the room if not is_guest.
-        res = yield self._filter_events_for_clients([(user_id, is_guest)], events)
+        res = yield self._filter_events_for_clients([(user_id, is_peeking)], events)
         defer.returnValue(res.get(user_id, []))
 
     def ratelimit(self, user_id):