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
@@ -4288,7 +4288,16 @@ export class MatrixClient extends EventEmitter {
|
|||||||
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
* @return {module:http-api.MatrixError} Rejects: with an error response.
|
||||||
*/
|
*/
|
||||||
public kick(roomId: string, userId: string, reason?: string, callback?: Callback): Promise<{}> {
|
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,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user