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

Merge branch 'develop' into access_token_header

This commit is contained in:
Krombel
2017-06-23 15:16:41 +02:00
parent e0a5edeb04
commit 9b24e66441
39 changed files with 2663 additions and 351 deletions

View File

@@ -678,6 +678,31 @@ MatrixBaseApis.prototype.setRoomDirectoryVisibilityAppService =
);
};
// User Directory Operations
// =========================
/**
* Query the user directory with a term matching user IDs, display names and domains.
* @param {object} opts options
* @param {string} opts.term the term with which to search.
* @param {number} opts.limit the maximum number of results to return. The server will
* apply a limit if unspecified.
* @return {module:client.Promise} Resolves: an array of results.
*/
MatrixBaseApis.prototype.searchUserDirectory = function(opts) {
const body = {
search_term: opts.term,
};
if (opts.limit !== undefined) {
body.limit = opts.limit;
}
return this._http.authedRequest(
undefined, "POST", "/user_directory/search", undefined, body,
);
};
// Media operations
// ================