mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 19:45:05 +01:00
Add kick, ban & unban api
This commit is contained in:
parent
92a8b4afd0
commit
7cfd34823b
@ -285,6 +285,27 @@ export class HomeServerApi {
|
||||
return this._post(`/rooms/${encodeURIComponent(roomId)}/forget`, {}, {}, options);
|
||||
}
|
||||
|
||||
kick(roomId: string, userId: string, reason?: string, options?: BaseRequestOptions): IHomeServerRequest {
|
||||
return this._post(`/rooms/${encodeURIComponent(roomId)}/kick`, {}, {
|
||||
user_id: userId,
|
||||
reason: reason,
|
||||
}, options);
|
||||
}
|
||||
|
||||
ban(roomId: string, userId: string, reason?: string, options?: BaseRequestOptions): IHomeServerRequest {
|
||||
return this._post(`/rooms/${encodeURIComponent(roomId)}/ban`, {}, {
|
||||
user_id: userId,
|
||||
reason: reason,
|
||||
}, options);
|
||||
}
|
||||
|
||||
unban(roomId: string, userId: string, reason?: string, options?: BaseRequestOptions): IHomeServerRequest {
|
||||
return this._post(`/rooms/${encodeURIComponent(roomId)}/unban`, {}, {
|
||||
user_id: userId,
|
||||
reason: reason,
|
||||
}, options);
|
||||
}
|
||||
|
||||
logout(options?: BaseRequestOptions): IHomeServerRequest {
|
||||
return this._post(`/logout`, {}, {}, options);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user