1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

deleteAlias() support

This commit is contained in:
Matthew Hodgson
2016-01-16 00:58:44 +00:00
parent a8d24798e6
commit 67872206ff

View File

@@ -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. * Get room info for the given alias.
* @param {string} alias The room alias to resolve. * @param {string} alias The room alias to resolve.