You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Add wrapped to set group is_joinable (#634)
which is exposed in the summary API under `summary.profile.is_joinable`. If true, anyone can join the group. If false, an invite is required.
This commit is contained in:
@@ -443,6 +443,20 @@ MatrixBaseApis.prototype.setGroupProfile = function(groupId, profile) {
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} groupId
|
||||
* @param {boolean} isJoinable whether anyone can join the group or only those who
|
||||
* are invited.
|
||||
* @return {module:client.Promise} Resolves: Empty object
|
||||
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||
*/
|
||||
MatrixBaseApis.prototype.setGroupJoinable = function(groupId, isJoinable) {
|
||||
const path = utils.encodeUri("/groups/$groupId/joinable", {$groupId: groupId});
|
||||
return this._http.authedRequest(
|
||||
undefined, "PUT", path, undefined, { joinable: isJoinable },
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} groupId
|
||||
* @return {module:client.Promise} Resolves: Group users list object
|
||||
|
||||
Reference in New Issue
Block a user