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

Switch to /kick API

Signed-off-by: Aaron Raimist <aaron@raim.ist>
This commit is contained in:
Aaron Raimist
2021-09-17 01:05:16 -05:00
parent 4f387d15b9
commit 35ee58dfe1

View File

@@ -4288,7 +4288,16 @@ export class MatrixClient extends EventEmitter {
* @return {module:http-api.MatrixError} Rejects: with an error response.
*/
public kick(roomId: string, userId: string, reason?: string, callback?: Callback): Promise<{}> {
return this.setMembershipState(roomId, userId, "leave", reason, callback);
const path = utils.encodeUri("/rooms/$roomId/kick", {
$roomId: roomId,
});
const data = {
user_id: userId,
reason: reason,
};
return this.http.authedRequest(
callback, "POST", path, undefined, data,
);
}
/**