summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2016-02-19 17:11:11 +0000
committerRichard van der Hoff <richard@matrix.org>2016-02-19 17:11:11 +0000
commit6c5b147a39c4c1ee5bc0ec0decacebb9f32de286 (patch)
tree84b5943c69b45f37f424f76620bc9db546c8ed3c /synapse/handlers/_base.py
parentMerge branch 'develop' into rav/guest_access_after_room_join (diff)
downloadsynapse-6c5b147a39c4c1ee5bc0ec0decacebb9f32de286.tar.xz
Interpret unknown visibilities the same as shared
Diffstat (limited to '')
-rw-r--r--synapse/handlers/_base.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index f01ab6780b..ef6716002c 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -111,22 +111,24 @@ class BaseHandler(object):
                 # return True
                 pass
 
-            if visibility == "shared":
-                # user can also see the event if he has become a member since
-                # the event
-                #
-                # XXX: if the user has subsequently joined and then left again,
-                # ideally we would share history up to the point they left. But
-                # we don't know when they left.
-                return not is_peeking
+            if visibility == "joined":
+                # we weren't a member at the time of the event, so we can't
+                # see this event.
+                return False
+
             elif visibility == "invited":
                 # user can also see the event if he was *invited* at the time
                 # of the event.
                 return membership == Membership.INVITE
 
-            # presumably visibility is "joined"; we weren't a member at the
-            # time of the event, so we're done.
-            return False
+            else:
+                # visibility is shared: user can also see the event if he has
+                # become a member since the event
+                #
+                # XXX: if the user has subsequently joined and then left again,
+                # ideally we would share history up to the point they left. But
+                # we don't know when they left.
+                return not is_peeking
 
         defer.returnValue({
             user_id: [