summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--synapse/handlers/room.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py
index 1d4c2c39a1..71f7ab3d22 100644
--- a/synapse/handlers/room.py
+++ b/synapse/handlers/room.py
@@ -946,7 +946,8 @@ class RoomMemberHandler(BaseHandler):
                 user_id, room_id
             ))
 
-        yield self.store.forget(user_id, room_id)
+        if membership:
+            yield self.store.forget(user_id, room_id)
 
 
 class RoomListHandler(BaseHandler):