diff options
author | Erik Johnston <erik@matrix.org> | 2014-11-12 11:22:51 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2014-11-12 11:24:11 +0000 |
commit | 6fea478d2e7737c2462b074b935d4427ced5f3d4 (patch) | |
tree | b14646c2e337e3a4d44fd7a61cb6bac60b8c42c6 /synapse/handlers/room.py | |
parent | SYWEB-146: Fix room ID leaking on recents page when the name of the room is j... (diff) | |
download | synapse-6fea478d2e7737c2462b074b935d4427ced5f3d4.tar.xz |
Fix bugs with invites/joins across federatiom.
Both in terms of auth and not trying to fetch missing PDUs for invites, joins etc.
Diffstat (limited to 'synapse/handlers/room.py')
-rw-r--r-- | synapse/handlers/room.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 3642fcfc6d..825957f721 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -24,6 +24,7 @@ from synapse.api.events.room import ( RoomTopicEvent, RoomNameEvent, RoomJoinRulesEvent, ) from synapse.util import stringutils +from synapse.util.async import run_on_reactor from ._base import BaseHandler import logging @@ -432,9 +433,12 @@ class RoomMemberHandler(BaseHandler): # that we are allowed to join when we decide whether or not we # need to do the invite/join dance. - hosts = yield self.store.get_joined_hosts_for_room(room_id) + is_host_in_room = yield self.auth.check_host_in_room( + event.room_id, + self.hs.hostname + ) - if self.hs.hostname in hosts: + if is_host_in_room: should_do_dance = False elif room_host: should_do_dance = True @@ -517,6 +521,8 @@ class RoomMemberHandler(BaseHandler): @defer.inlineCallbacks def _do_local_membership_update(self, event, membership, snapshot, do_auth): + yield run_on_reactor() + # If we're inviting someone, then we should also send it to that # HS. target_user_id = event.state_key |