summary refs log tree commit diff
path: root/synapse/handlers/federation.py
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2020-03-19 17:48:40 +0000
committerAndrew Morgan <andrew@amorgan.xyz>2020-03-19 17:48:40 +0000
commit2f42d6f84623450308b7a267156aa0d3ed9eebf3 (patch)
treeb13fdf6f1e89967ac96ae7457a21eb828b945138 /synapse/handlers/federation.py
parentMerge pull request #6349 from matrix-org/babolivier/msc1802 (diff)
parentPrevent message search in upgraded rooms we're not in (#6385) (diff)
downloadsynapse-2f42d6f84623450308b7a267156aa0d3ed9eebf3.tar.xz
Prevent message search in upgraded rooms we're not in (#6385)
* commit 'ea0f0ad41':
  Prevent message search in upgraded rooms we're not in (#6385)
Diffstat (limited to 'synapse/handlers/federation.py')
-rw-r--r--synapse/handlers/federation.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/synapse/handlers/federation.py b/synapse/handlers/federation.py
index 3728a66260..e25f206a07 100644
--- a/synapse/handlers/federation.py
+++ b/synapse/handlers/federation.py
@@ -1299,7 +1299,7 @@ class FederationHandler(BaseHandler):
             # Check whether this room is the result of an upgrade of a room we already know
             # about. If so, migrate over user information
             predecessor = yield self.store.get_room_predecessor(room_id)
-            if not predecessor:
+            if not predecessor or not isinstance(predecessor.get("room_id"), str):
                 return
             old_room_id = predecessor["room_id"]
             logger.debug(
@@ -1549,7 +1549,7 @@ class FederationHandler(BaseHandler):
     @defer.inlineCallbacks
     def do_remotely_reject_invite(self, target_hosts, room_id, user_id, content):
         origin, event, event_format_version = yield self._make_and_verify_event(
-            target_hosts, room_id, user_id, "leave", content=content,
+            target_hosts, room_id, user_id, "leave", content=content
         )
         # Mark as outlier as we don't have any state for this event; we're not
         # even in the room.