summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-05-05 15:43:49 +0100
committerMark Haines <mark.haines@matrix.org>2015-05-05 15:43:49 +0100
commitbfa4a7f8b023d91f93d4a5f0e8bd592400a2e166 (patch)
tree5f8f1c5ff5be0d57d1ddaecb5f08e38fd3b514b5 /synapse/storage
parentMissing return for when the event was already persisted (diff)
downloadsynapse-bfa4a7f8b023d91f93d4a5f0e8bd592400a2e166.tar.xz
Invalidate the room_member cache if the current state events updates
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/events.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/synapse/storage/events.py b/synapse/storage/events.py
index 16359e876c..7dc49ceed6 100644
--- a/synapse/storage/events.py
+++ b/synapse/storage/events.py
@@ -120,6 +120,11 @@ class EventsStore(SQLBaseStore):
             )
 
             for s in current_state:
+                if s.type == EventTypes.Member:
+                    invalidates.extend([
+                        (self.get_rooms_for_user.invalidate, s.state_key),
+                        (self.get_joined_hosts_for_room.invalidate, s.room_id),
+                    ])
                 self._simple_insert_txn(
                     txn,
                     "current_state_events",