1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

add method for new /aliases endpoint

This commit is contained in:
Bruno Windels
2020-02-18 15:33:41 +01:00
parent 04a3aaee35
commit fe97dc3ece

View File

@@ -1119,6 +1119,19 @@ MatrixBaseApis.prototype.deleteAlias = function(alias, callback) {
);
};
/**
* @param {string} roomId
* @param {module:client.callback} callback Optional.
* @return {Promise} Resolves: an object with an `aliases` property, containing an array of local aliases
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixBaseApis.prototype.getLocalAliases =
function(roomId, callback) {
const path = utils.encodeUri("/rooms/$roomId/aliases",
{$roomId: roomId});
return this._http.authedRequest(callback, "GET", path);
};
/**
* Get room info for the given alias.
* @param {string} alias The room alias to resolve.