1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Support sending additional options with acceptance (#570)

To be able to send things like `{visibility: { type: 'private ' }}`

Signed-off-by: Travis Ralston <travpc@gmail.com>
This commit is contained in:
Travis Ralston
2017-11-10 07:14:11 -07:00
committed by Luke Barnard
parent 0143ac2a86
commit 7a59579dcd

View File

@@ -616,15 +616,16 @@ MatrixBaseApis.prototype.removeRoomFromGroup = function(groupId, roomId) {
/** /**
* @param {string} groupId * @param {string} groupId
* @param {Object} opts Additional options to send alongside the acceptance.
* @return {module:client.Promise} Resolves: Empty object * @return {module:client.Promise} Resolves: Empty object
* @return {module:http-api.MatrixError} Rejects: with an error response. * @return {module:http-api.MatrixError} Rejects: with an error response.
*/ */
MatrixBaseApis.prototype.acceptGroupInvite = function(groupId) { MatrixBaseApis.prototype.acceptGroupInvite = function(groupId, opts = null) {
const path = utils.encodeUri( const path = utils.encodeUri(
"/groups/$groupId/self/accept_invite", "/groups/$groupId/self/accept_invite",
{$groupId: groupId}, {$groupId: groupId},
); );
return this._http.authedRequest(undefined, "PUT", path, undefined, {}); return this._http.authedRequest(undefined, "PUT", path, undefined, opts || {});
}; };
/** /**