You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Add wrapper for group join API (#633)
Needed for new "joinable" groups.
This commit is contained in:
@@ -633,6 +633,19 @@ MatrixBaseApis.prototype.acceptGroupInvite = function(groupId, opts = null) {
|
|||||||
return this._http.authedRequest(undefined, "PUT", path, undefined, opts || {});
|
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
|
* @param {string} groupId
|
||||||
* @return {module:client.Promise} Resolves: Empty object
|
* @return {module:client.Promise} Resolves: Empty object
|
||||||
|
|||||||
Reference in New Issue
Block a user