Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add method for new /aliases endpoint #1219

Merged
merged 4 commits into from
Feb 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/base-apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
bwindels marked this conversation as resolved.
Show resolved Hide resolved
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.
Expand Down