You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Merge pull request #512 from matrix-org/dbkr/groupview_edit
Add more group APIs
This commit is contained in:
@@ -411,6 +411,33 @@ MatrixBaseApis.prototype.getGroupSummary = function(groupId) {
|
||||
return this._http.authedRequest(undefined, "GET", path);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} groupId
|
||||
* @param {Object} profile The group profile object
|
||||
* @param {string=} profile.name Name of the group
|
||||
* @param {string=} profile.avatar_url MXC avatar URL
|
||||
* @param {string=} profile.short_description A short description of the room
|
||||
* @param {string=} profile.long_description A longer HTML description of the room
|
||||
* @return {module:client.Promise} Resolves: Empty object
|
||||
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||
*/
|
||||
MatrixBaseApis.prototype.setGroupProfile = function(groupId, profile) {
|
||||
const path = utils.encodeUri("/groups/$groupId/profile", {$groupId: groupId});
|
||||
return this._http.authedRequest(
|
||||
undefined, "POST", path, undefined, profile,
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param {string} groupId
|
||||
* @return {module:client.Promise} Resolves: Group users list object
|
||||
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||
*/
|
||||
MatrixBaseApis.prototype.getGroupUsers = function(groupId) {
|
||||
const path = utils.encodeUri("/groups/$groupId/users", {$groupId: groupId});
|
||||
return this._http.authedRequest(undefined, "GET", path);
|
||||
};
|
||||
|
||||
/**
|
||||
* @return {module:client.Promise} Resolves: The groups to which the user is joined
|
||||
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||
|
||||
Reference in New Issue
Block a user