summary refs log tree commit diff
path: root/synapse/storage/roommember.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2016-01-18 10:45:09 +0000
committerErik Johnston <erik@matrix.org>2016-01-18 14:43:50 +0000
commitcc66a9a5e3fc954b0da48ba891e9f77be31aa832 (patch)
tree230d80668cd13e86931ffa61b711746a5b432de7 /synapse/storage/roommember.py
parentMerge pull request #501 from matrix-org/daniel/unban (diff)
downloadsynapse-cc66a9a5e3fc954b0da48ba891e9f77be31aa832.tar.xz
Allow filtering events for multiple users at once
Diffstat (limited to '')
-rw-r--r--synapse/storage/roommember.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/synapse/storage/roommember.py b/synapse/storage/roommember.py
index 7d3ce4579d..68ac88905f 100644
--- a/synapse/storage/roommember.py
+++ b/synapse/storage/roommember.py
@@ -287,6 +287,7 @@ class RoomMemberStore(SQLBaseStore):
             txn.execute(sql, (user_id, room_id))
         yield self.runInteraction("forget_membership", f)
         self.was_forgotten_at.invalidate_all()
+        self.who_forgot_in_room.invalidate_all()
         self.did_forget.invalidate((user_id, room_id))
 
     @cachedInlineCallbacks(num_args=2)
@@ -336,3 +337,15 @@ class RoomMemberStore(SQLBaseStore):
             return rows[0][0]
         forgot = yield self.runInteraction("did_forget_membership_at", f)
         defer.returnValue(forgot == 1)
+
+    @cached()
+    def who_forgot_in_room(self, room_id):
+        return self._simple_select_list(
+            table="room_memberships",
+            retcols=("user_id", "event_id"),
+            keyvalues={
+                "room_id": room_id,
+                "forgotten": 1,
+            },
+            desc="who_forgot"
+        )