diff --git a/src/base-apis.js b/src/base-apis.js index 7f395361a..1d59d9137 100644 --- a/src/base-apis.js +++ b/src/base-apis.js @@ -633,6 +633,19 @@ MatrixBaseApis.prototype.acceptGroupInvite = function(groupId, opts = null) { return this._http.authedRequest(undefined, "PUT", path, undefined, opts || {}); }; +/** + * @param {string} groupId + * @return {module:client.Promise} Resolves: Empty object + * @return {module:http-api.MatrixError} Rejects: with an error response. + */ +MatrixBaseApis.prototype.joinGroup = function(groupId) { + const path = utils.encodeUri( + "/groups/$groupId/self/join", + {$groupId: groupId}, + ); + return this._http.authedRequest(undefined, "PUT", path, undefined, {}); +}; + /** * @param {string} groupId * @return {module:client.Promise} Resolves: Empty object