diff --git a/internal/types/event/events.go b/internal/types/event/events.go index 2f8432e2..825015ee 100644 --- a/internal/types/event/events.go +++ b/internal/types/event/events.go @@ -38,7 +38,6 @@ const ( ) const ( - ADMIN_KICK = "admin/kick" ADMIN_CONTROL = "admin/control" ADMIN_RELEASE = "admin/release" ADMIN_GIVE = "admin/give" diff --git a/internal/websocket/handler/admin.go b/internal/websocket/handler/admin.go index 0b3994bc..9dbef032 100644 --- a/internal/websocket/handler/admin.go +++ b/internal/websocket/handler/admin.go @@ -83,34 +83,3 @@ func (h *MessageHandlerCtx) adminGive(session types.Session, payload *message.Ad return nil } - -func (h *MessageHandlerCtx) adminKick(session types.Session, payload *message.Admin) error { - if !session.Admin() { - h.logger.Debug().Msg("user not admin") - return nil - } - - target, ok := h.sessions.Get(payload.ID) - if !ok { - h.logger.Debug().Str("id", payload.ID).Msg("can't find target session") - return nil - } - - if target.Admin() { - h.logger.Debug().Msg("target is an admin, baling") - return nil - } - - if err := target.Disconnect("kicked"); err != nil { - return err - } - - h.sessions.Broadcast( - message.AdminTarget{ - Event: event.ADMIN_KICK, - Target: target.ID(), - ID: session.ID(), - }, []string{payload.ID}) - - return nil -} diff --git a/internal/websocket/handler/handler.go b/internal/websocket/handler/handler.go index 9eadc80f..055e3aff 100644 --- a/internal/websocket/handler/handler.go +++ b/internal/websocket/handler/handler.go @@ -104,11 +104,6 @@ func (h *MessageHandlerCtx) Message(session types.Session, raw []byte) error { err = utils.Unmarshal(payload, raw, func() error { return h.adminGive(session, payload) }) - case event.ADMIN_KICK: - payload := &message.Admin{} - err = utils.Unmarshal(payload, raw, func() error { - return h.adminKick(session, payload) - }) default: return errors.Errorf("unknown message event %s", header.Event) }