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
Update to new join policy API (#636)
This commit is contained in:
committed by
Luke Barnard
parent
1afaf903f9
commit
730ca9b60b
@@ -445,15 +445,22 @@ MatrixBaseApis.prototype.setGroupProfile = function(groupId, profile) {
|
||||
|
||||
/**
|
||||
* @param {string} groupId
|
||||
* @param {boolean} isJoinable whether anyone can join the group or only those who
|
||||
* are invited.
|
||||
* @param {object} policy The join policy for the group. Must include at
|
||||
* least a 'type' field which is 'open' if anyone can join the group
|
||||
* the group without prior approval, or 'invite' if an invite is
|
||||
* required to join.
|
||||
* @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});
|
||||
MatrixBaseApis.prototype.setGroupJoinPolicy = function(groupId, policy) {
|
||||
const path = utils.encodeUri(
|
||||
"/groups/$groupId/settings/m.join_policy",
|
||||
{$groupId: groupId},
|
||||
);
|
||||
return this._http.authedRequest(
|
||||
undefined, "PUT", path, undefined, { joinable: isJoinable },
|
||||
undefined, "PUT", path, undefined, {
|
||||
'm.join_policy': policy,
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user