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

Merge branch 'develop' into kegan/indexeddb

This commit is contained in:
Kegan Dougal
2017-02-16 16:10:56 +00:00
10 changed files with 384 additions and 125 deletions

View File

@@ -1383,13 +1383,23 @@ MatrixClient.prototype.forget = function(roomId, deleteRoom, callback) {
* @param {string} roomId
* @param {string} userId
* @param {module:client.callback} callback Optional.
* @return {module:client.Promise} Resolves: TODO
* @return {module:client.Promise} Resolves: Object (currently empty)
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
MatrixClient.prototype.unban = function(roomId, userId, callback) {
// unbanning = set their state to leave
return _setMembershipState(
this, roomId, userId, "leave", undefined, callback,
// unbanning != set their state to leave: this used to be
// the case, but was then changed so that leaving was always
// a revoking of priviledge, otherwise two people racing to
// kick / ban someone could end up banning and then un-banning
// them.
const path = utils.encodeUri("/rooms/$roomId/unban", {
$roomId: roomId,
});
const data = {
user_id: userId,
};
return this._http.authedRequest(
callback, "POST", path, undefined, data,
);
};