summary refs log tree commit diff
path: root/synapse/handlers/directory.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2016-12-12 17:00:10 +0000
committerGitHub <noreply@github.com>2016-12-12 17:00:10 +0000
commit1574b839e02a38434371d1cd97559102319cf206 (patch)
tree2dae67cf8872c2231d4f140b8517e37308a19f9f /synapse/handlers/directory.py
parentMerge pull request #1694 from matrix-org/rav/no_get_e2e_keys (diff)
parentRename network_id to instance_id on client side (diff)
downloadsynapse-1574b839e02a38434371d1cd97559102319cf206.tar.xz
Merge pull request #1676 from matrix-org/erikj/room_list
Add new API appservice specific public room list
Diffstat (limited to 'synapse/handlers/directory.py')
-rw-r--r--synapse/handlers/directory.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/synapse/handlers/directory.py b/synapse/handlers/directory.py
index c00274afc3..1b5317edf5 100644
--- a/synapse/handlers/directory.py
+++ b/synapse/handlers/directory.py
@@ -339,3 +339,22 @@ class DirectoryHandler(BaseHandler):
         yield self.auth.check_can_change_room_list(room_id, requester.user)
 
         yield self.store.set_room_is_public(room_id, visibility == "public")
+
+    @defer.inlineCallbacks
+    def edit_published_appservice_room_list(self, appservice_id, network_id,
+                                            room_id, visibility):
+        """Add or remove a room from the appservice/network specific public
+        room list.
+
+        Args:
+            appservice_id (str): ID of the appservice that owns the list
+            network_id (str): The ID of the network the list is associated with
+            room_id (str)
+            visibility (str): either "public" or "private"
+        """
+        if visibility not in ["public", "private"]:
+            raise SynapseError(400, "Invalid visibility setting")
+
+        yield self.store.set_room_is_public_appservice(
+            room_id, appservice_id, network_id, visibility == "public"
+        )