summary refs log tree commit diff
path: root/synapse/handlers/room_member.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-09-05 11:53:11 +0100
committerErik Johnston <erik@matrix.org>2016-09-05 11:53:11 +0100
commitbb36b93f71bc6f11401cb1154f7415f0b9326009 (patch)
tree69f8c8fd451458844ceb830df9dbe8332b3d0d0a /synapse/handlers/room_member.py
parentAdd comments (diff)
parentMerge pull request #1067 from matrix-org/markjh/idempotent (diff)
downloadsynapse-bb36b93f71bc6f11401cb1154f7415f0b9326009.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/state_storage
Diffstat (limited to 'synapse/handlers/room_member.py')
-rw-r--r--synapse/handlers/room_member.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/synapse/handlers/room_member.py b/synapse/handlers/room_member.py
index 3ba5335af7..ba49075a20 100644
--- a/synapse/handlers/room_member.py
+++ b/synapse/handlers/room_member.py
@@ -85,6 +85,12 @@ class RoomMemberHandler(BaseHandler):
             prev_event_ids=prev_event_ids,
         )
 
+        # Check if this event matches the previous membership event for the user.
+        duplicate = yield msg_handler.deduplicate_state_event(event, context)
+        if duplicate is not None:
+            # Discard the new event since this membership change is a no-op.
+            return
+
         yield msg_handler.handle_new_client_event(
             requester,
             event,