From 67872206ff4c35b1dbb68d3e23f4f070e64157f4 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Sat, 16 Jan 2016 00:58:44 +0000 Subject: [PATCH] deleteAlias() support --- lib/client.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lib/client.js b/lib/client.js index a20c9de9c..11b9cf2f8 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1458,6 +1458,22 @@ MatrixClient.prototype.createAlias = function(alias, roomId, callback) { ); }; +/** + * Delete an alias to room ID mapping. This alias must be on your local server (I hope). + * @param {string} alias The room alias to delete. + * @param {module:client.callback} callback Optional. + * @return {module:client.Promise} Resolves: TODO. + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixClient.prototype.deleteAlias = function(alias, roomId, callback) { + var path = utils.encodeUri("/directory/room/$alias", { + $alias: alias + }); + return this._http.authedRequest( + callback, "DELETE", path, undefined, undefined + ); +}; + /** * Get room info for the given alias. * @param {string} alias The room alias to resolve.