add Kick.

This commit is contained in:
Miroslav Šedivý 2024-07-25 16:21:30 +02:00
parent ceb4e0c3f1
commit d62acec443

View file

@ -304,8 +304,11 @@ func (s *session) wsToBackend(msg []byte) error {
return err
}
// TODO: No WS equivalent, call HTTP API.
return fmt.Errorf("event not implemented: %s", header.Event)
// TODO: we need to send a message to the user before kicking them
// that they are being kicked so they will not automatically rejoin
return s.apiReq(http.MethodPost, "/api/members/"+request.ID, map[string]any{
"can_login": false,
}, nil)
case oldEvent.ADMIN_MUTE:
request := &oldMessage.Admin{}