summary refs log tree commit diff
path: root/synapse/handlers/room_member.py
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2018-07-23 17:15:12 +0100
committerRichard van der Hoff <richard@matrix.org>2018-07-23 17:15:12 +0100
commit4f5cc8e4e796153cbdc09517e521fc3a23eb66c2 (patch)
treeccaa25ba8cec666b88ac217f6495cf59663550b0 /synapse/handlers/room_member.py
parentRemove redundant checks on room forgottenness (diff)
parentMerge pull request #3582 from matrix-org/erikj/fixup_stateless (diff)
downloadsynapse-4f5cc8e4e796153cbdc09517e521fc3a23eb66c2.tar.xz
Merge remote-tracking branch 'origin/develop' into rav/remove_who_forgot_in_room
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r--synapse/handlers/room_member.py9
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
         )