summary refs log tree commit diff
path: root/synapse/handlers/_base.py
diff options
context:
space:
mode:
authorSteven Hammerton <steven.hammerton@openmarket.com>2015-11-05 20:59:45 +0000
committerSteven Hammerton <steven.hammerton@openmarket.com>2015-11-05 20:59:45 +0000
commitfece2f5c771ca4baab8a0541ede8af2e33ff1b41 (patch)
tree22973a8a9a9b806cb09d734e19cb5150686e9869 /synapse/handlers/_base.py
parentAllow hs to do CAS login completely and issue the client with a login token t... (diff)
parentMerge pull request #350 from matrix-org/erikj/search (diff)
downloadsynapse-fece2f5c771ca4baab8a0541ede8af2e33ff1b41.tar.xz
Merge branch 'develop' into sh-cas-auth-via-homeserver
Diffstat (limited to 'synapse/handlers/_base.py')
-rw-r--r--synapse/handlers/_base.py18
1 files changed, 5 insertions, 13 deletions
diff --git a/synapse/handlers/_base.py b/synapse/handlers/_base.py
index 6873a4575d..eef325a94b 100644
--- a/synapse/handlers/_base.py
+++ b/synapse/handlers/_base.py
@@ -21,7 +21,6 @@ from synapse.api.constants import Membership, EventTypes
 from synapse.types import UserID, RoomAlias
 
 from synapse.util.logcontext import PreserveLoggingContext
-from synapse.util import third_party_invites
 
 import logging
 
@@ -47,7 +46,8 @@ class BaseHandler(object):
         self.event_builder_factory = hs.get_event_builder_factory()
 
     @defer.inlineCallbacks
-    def _filter_events_for_client(self, user_id, events, is_guest=False):
+    def _filter_events_for_client(self, user_id, events, is_guest=False,
+                                  require_all_visible_for_guests=True):
         # Assumes that user has at some point joined the room if not is_guest.
 
         def allowed(event, membership, visibility):
@@ -100,7 +100,9 @@ class BaseHandler(object):
             if should_include:
                 events_to_return.append(event)
 
-        if is_guest and len(events_to_return) < len(events):
+        if (require_all_visible_for_guests
+                and is_guest
+                and len(events_to_return) < len(events)):
             # This indicates that some events in the requested range were not
             # visible to guest users. To be safe, we reject the entire request,
             # so that we don't have to worry about interpreting visibility
@@ -189,16 +191,6 @@ class BaseHandler(object):
                         )
                     )
 
-        if (
-            event.type == EventTypes.Member and
-            event.content["membership"] == Membership.JOIN and
-            third_party_invites.join_has_third_party_invite(event.content)
-        ):
-            yield third_party_invites.check_key_valid(
-                self.hs.get_simple_http_client(),
-                event
-            )
-
         federation_handler = self.hs.get_handlers().federation_handler
 
         if event.type == EventTypes.Member: