Skip to content

Commit

Permalink
Add setRoomDirectoryVisibilityAppService
Browse files Browse the repository at this point in the history
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 matrix-org/synapse#1676 (comment).
  • Loading branch information
Luke Barnard committed Dec 12, 2016
1 parent 73e86bf commit 742d942
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions lib/base-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ================
Expand Down

0 comments on commit 742d942

Please sign in to comment.