From 742d942baa4ccbed564a0a35b76cc53392ab9b18 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 12 Dec 2016 13:52:44 +0000 Subject: [PATCH] Add setRoomDirectoryVisibilityAppService This is for setting the publicity of a room that is bridged to a 3rd party network. This change reflects the second bullet point of https://github.com/matrix-org/synapse/pull/1676#issue-193810881. --- lib/base-apis.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/base-apis.js b/lib/base-apis.js index bfed201a7..271a69d8f 100644 --- a/lib/base-apis.js +++ b/lib/base-apis.js @@ -570,6 +570,30 @@ MatrixBaseApis.prototype.setRoomDirectoryVisibility = ); }; +/** + * Set the visbility of a room bridged to a 3rd party network in + * the current HS's room directory. + * @param {string} networkId the network ID of the 3rd party + * instance under which this room is published under. + * @param {string} roomId + * @param {string} visibility "public" to make the room visible + * in the public directory, or "private" to make + * it invisible. + * @param {module:client.callback} callback Optional. + * @return {module:client.Promise} Resolves: result object + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.setRoomDirectoryVisibilityAppService = + function(networkId, roomId, visibility, callback) { + var path = utils.encodeUri("/directory/list/appservice/$networkId/$roomId", { + $networkId: networkId, + $roomId: roomId + }); + return this._http.authedRequest( + callback, "PUT", path, undefined, { "visibility": visibility } + ); +}; + // Media operations // ================