1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Add wrapper for group update_publicity API (#550)

Add wrapper for group update_publicity API
This commit is contained in:
David Baker
2017-09-25 15:27:59 +01:00
committed by Luke Barnard
parent 787af6448d
commit a8a50384b8

View File

@@ -617,6 +617,22 @@ MatrixBaseApis.prototype.getPublicisedGroups = function(userIds) {
);
};
/**
* @param {string} groupId
* @param {bool} isPublic Whether the user's mebership of this group is made public
* @return {module:client.Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixBaseApis.prototype.setGroupPublicity = function(groupId, isPublic) {
const path = utils.encodeUri(
"/groups/$groupId/self/update_publicity",
{$groupId: groupId},
);
return this._http.authedRequest(undefined, "PUT", path, undefined, {
publicise: isPublic,
});
};
/**
* Retrieve a state event.
* @param {string} roomId