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 update_publicity API (#550)
Add wrapper for group update_publicity API
This commit is contained in:
committed by
Luke Barnard
parent
787af6448d
commit
a8a50384b8
@@ -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.
|
* Retrieve a state event.
|
||||||
* @param {string} roomId
|
* @param {string} roomId
|
||||||
|
|||||||
Reference in New Issue
Block a user