diff options
author | Erik Johnston <erikj@jki.re> | 2018-07-24 09:57:05 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-24 09:57:05 +0100 |
commit | 536bc63a4e6833be9c8700f4382949238f8a4bf4 (patch) | |
tree | 5f804ee05b6472691cd12c5cb51d56453d5a367a /synapse/handlers/room_member.py | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/client_api... (diff) | |
parent | Merge pull request #3584 from matrix-org/erikj/use_cached (diff) | |
download | synapse-536bc63a4e6833be9c8700f4382949238f8a4bf4.tar.xz |
Merge branch 'develop' into erikj/client_apis_move
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r-- | synapse/handlers/room_member.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py index 00f2e279bc..a832d91809 100644 --- a/synapse/handlers/room_member.py +++ b/synapse/handlers/room_member.py @@ -201,7 +201,9 @@ class RoomMemberHandler(object): ratelimit=ratelimit, ) - prev_member_event_id = context.prev_state_ids.get( + prev_state_ids = yield context.get_prev_state_ids(self.store) + + prev_member_event_id = prev_state_ids.get( (EventTypes.Member, target.to_string()), None ) @@ -496,9 +498,10 @@ class RoomMemberHandler(object): if prev_event is not None: return + prev_state_ids = yield context.get_prev_state_ids(self.store) if event.membership == Membership.JOIN: if requester.is_guest: - guest_can_join = yield self._can_guest_join(context.prev_state_ids) + guest_can_join = yield self._can_guest_join(prev_state_ids) if not guest_can_join: # This should be an auth check, but guests are a local concept, # so don't really fit into the general auth process. @@ -517,7 +520,7 @@ class RoomMemberHandler(object): ratelimit=ratelimit, ) - prev_member_event_id = context.prev_state_ids.get( + prev_member_event_id = prev_state_ids.get( (EventTypes.Member, event.state_key), None ) |