diff --git a/src/base-apis.js b/src/base-apis.js index b0b132fed..1515ca735 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -948,6 +948,20 @@ MatrixBaseApis.prototype.getJoinedRooms = function() { return this._http.authedRequest(undefined, "GET", path); }; +/** + * Retrieve membership info. for a room. + * @param {string} roomId ID of the room to get membership for + * @return {module:client.Promise} Resolves: A list of currently joined users + * and their profile data. + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.getJoinedRoomMembers = function(roomId) { + const path = utils.encodeUri("/rooms/$roomId/joined_members", { + $roomId: roomId, + }); + return this._http.authedRequest(undefined, "GET", path); +}; + // Room Directory operations // =========================