diff --git a/src/base-apis.js b/src/base-apis.js index 1249dcd31..6e9364b0b 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -411,6 +411,33 @@ MatrixBaseApis.prototype.getGroupSummary = function(groupId) { return this._http.authedRequest(undefined, "GET", path); }; +/** + * @param {string} groupId + * @param {Object} profile The group profile object + * @param {string=} profile.name Name of the group + * @param {string=} profile.avatar_url MXC avatar URL + * @param {string=} profile.short_description A short description of the room + * @param {string=} profile.long_description A longer HTML description of the room + * @return {module:client.Promise} Resolves: Empty object + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.setGroupProfile = function(groupId, profile) { + const path = utils.encodeUri("/groups/$groupId/profile", {$groupId: groupId}); + return this._http.authedRequest( + undefined, "POST", path, undefined, profile, + ); +}; + +/** + * @param {string} groupId + * @return {module:client.Promise} Resolves: Group users list object + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.getGroupUsers = function(groupId) { + const path = utils.encodeUri("/groups/$groupId/users", {$groupId: groupId}); + return this._http.authedRequest(undefined, "GET", path); +}; + /** * @return {module:client.Promise} Resolves: The groups to which the user is joined * @return {module:http-api.MatrixError} Rejects: with an error response.