diff --git a/src/base-apis.js b/src/base-apis.js index 61b6df19f10..69e1d5d92c0 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -448,6 +448,16 @@ MatrixBaseApis.prototype.getGroupUsers = function(groupId) { return this._http.authedRequest(undefined, "GET", path); }; +/** + * @param {string} groupId + * @return {module:client.Promise} Resolves: Group rooms list object + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.getGroupRooms = function(groupId) { + const path = utils.encodeUri("/groups/$groupId/rooms", {$groupId: groupId}); + return this._http.authedRequest(undefined, "GET", path); +}; + /** * @param {string} groupId * @param {string} userId @@ -493,6 +503,23 @@ MatrixBaseApis.prototype.addUserToGroupSummary = function(groupId, userId, roleI return this._http.authedRequest(undefined, "PUT", path, undefined, {}); }; +/** + * @param {string} groupId + * @param {string} roomId + * @param {string} categoryId Optional. + * @return {module:client.Promise} Resolves: Empty object + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.addRoomToGroupSummary = function(groupId, roomId, categoryId) { + const path = utils.encodeUri( + categoryId ? + "/groups/$groupId/summary/$categoryId/rooms/$roomId" : + "/groups/$groupId/summary/rooms/$roomId", + {$groupId: groupId, $categoryId: categoryId, $roomId: roomId}, + ); + return this._http.authedRequest(undefined, "PUT", path, undefined, {}); +}; + /** * @param {string} groupId * @return {module:client.Promise} Resolves: Empty object