diff options
author | Erik Johnston <erik@matrix.org> | 2018-07-23 13:00:22 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2018-07-23 13:17:22 +0100 |
commit | e42510ba635b3e4d83215e4f5634ca51411996e0 (patch) | |
tree | 3869fe60b9f56c0f0d157e936538b2a887e78be9 /synapse/handlers/room_member.py | |
parent | Make EventContext lazy load state (diff) | |
download | synapse-e42510ba635b3e4d83215e4f5634ca51411996e0.tar.xz |
Use new getters
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 ) |