summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-03-20 16:50:05 +0000
committerErik Johnston <erik@matrix.org>2019-03-20 16:50:05 +0000
commit67d618e111bd586fb0b4d6c92c9d43b1174b0f42 (patch)
treed22a0dcbcb8ca55a5189ebcf7a0ae025dd7222ef
parentBatching in the user directory import (#4900) (diff)
downloadsynapse-67d618e111bd586fb0b4d6c92c9d43b1174b0f42.tar.xz
Allow blocking a room multiple times
-rw-r--r--synapse/storage/room.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index 41c65e112a..33870b585e 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -500,10 +500,12 @@ class RoomStore(RoomWorkerStore, SearchStore):
 
     @defer.inlineCallbacks
     def block_room(self, room_id, user_id):
-        yield self._simple_insert(
+        yield self._simple_upsert(
             table="blocked_rooms",
-            values={
+            keyvalues={
                 "room_id": room_id,
+            },
+            insertion_values={
                 "user_id": user_id,
             },
             desc="block_room",