summary refs log tree commit diff
path: root/synapse/storage/roommember.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-09-25 17:02:53 +0100
committerErik Johnston <erik@matrix.org>2014-09-25 17:02:53 +0100
commit37bfe44046d46effba5f86b65ab37fa0d0c505b0 (patch)
tree9524fd5e5ac1637982549030a2759aaf538e8ac2 /synapse/storage/roommember.py
parentfix rst warnings (diff)
parentDon't strip out null's in serialized events, as that is not need anymore and ... (diff)
downloadsynapse-37bfe44046d46effba5f86b65ab37fa0d0c505b0.tar.xz
Merge branch 'deletions' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'synapse/storage/roommember.py')
-rw-r--r--synapse/storage/roommember.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index 04b4067d03..958e730591 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -182,14 +182,22 @@ class RoomMemberStore(SQLBaseStore):
         )
 
     def _get_members_query_txn(self, txn, where_clause, where_values):
+        del_sql = (
+            "SELECT event_id FROM redactions WHERE redacts = e.event_id "
+            "LIMIT 1"
+        )
+
         sql = (
-            "SELECT e.* FROM events as e "
+            "SELECT e.*, (%(redacted)s) AS redacted FROM events as e "
             "INNER JOIN room_memberships as m "
             "ON e.event_id = m.event_id "
             "INNER JOIN current_state_events as c "
             "ON m.event_id = c.event_id "
-            "WHERE %s "
-        ) % (where_clause,)
+            "WHERE %(where)s "
+        ) % {
+            "redacted": del_sql,
+            "where": where_clause,
+        }
 
         txn.execute(sql, where_values)
         rows = self.cursor_to_dict(txn)