summary refs log tree commit diff
path: root/synapse/storage/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-24 13:29:20 +0100
committerErik Johnston <erik@matrix.org>2014-09-24 13:29:20 +0100
commit1e6c5b205c95c1f6941688c13a15314100a8470d (patch)
treed7a69c914a85be8474daf241d78438237f7cfb32 /synapse/storage/__init__.py
parentFill out the prune_event method. (diff)
downloadsynapse-1e6c5b205c95c1f6941688c13a15314100a8470d.tar.xz
Fix bug where we didn't correctly pull out the event_id of the deletion
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 4e8a54c8f7..0d57073aa4 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -263,13 +263,17 @@ class DataStore(RoomMemberStore, RoomStore,
 
     @defer.inlineCallbacks
     def get_current_state(self, room_id, event_type=None, state_key=""):
+        del_sql = (
+            "SELECT event_id FROM deletions WHERE deletes = e.event_id"
+        )
+
         sql = (
             "SELECT e.*, (%(deleted)s) AS deleted FROM events as e "
             "INNER JOIN current_state_events as c ON e.event_id = c.event_id "
             "INNER JOIN state_events as s ON e.event_id = s.event_id "
             "WHERE c.room_id = ? "
         ) % {
-            "deleted": "e.event_id IN (SELECT deletes FROM deletions)",
+            "deleted": del_sql,
         }
 
         if event_type: