diff --git a/client/src/neko/messages.ts b/client/src/neko/messages.ts index 67138c5..5192b54 100644 --- a/client/src/neko/messages.ts +++ b/client/src/neko/messages.ts @@ -29,7 +29,6 @@ export type WebSocketPayloads = | MemberListPayload | Member | ControlPayload - | ControlRequestPayload | ControlClipboardPayload | ControlKeyboardPayload | ChatPayload @@ -113,10 +112,6 @@ export interface ControlPayload { id: string } -export interface ControlRequestPayload { - keyboard_layout: string -} - export interface ControlTargetPayload { id: string target: string diff --git a/client/src/store/remote.ts b/client/src/store/remote.ts index 95d5165..991ccc6 100644 --- a/client/src/store/remote.ts +++ b/client/src/store/remote.ts @@ -64,7 +64,7 @@ export const actions = actionTree( } if (!getters.hosting) { - $client.sendMessage(EVENT.CONTROL.REQUEST, { keyboard_layout: accessor.settings.keyboard_layout }) + $client.sendMessage(EVENT.CONTROL.REQUEST) } else { $client.sendMessage(EVENT.CONTROL.RELEASE) } diff --git a/server/internal/types/message/messages.go b/server/internal/types/message/messages.go index d3287b3..9d99481 100644 --- a/server/internal/types/message/messages.go +++ b/server/internal/types/message/messages.go @@ -56,11 +56,6 @@ type Control struct { ID string `json:"id"` } -type ControlRequest struct { - Event string `json:"event"` - KeyboardLayout string `json:"keyboard_layout"` -} - type ControlTarget struct { Event string `json:"event"` ID string `json:"id"` diff --git a/server/internal/websocket/control.go b/server/internal/websocket/control.go index 8b96bd9..234c5d0 100644 --- a/server/internal/websocket/control.go +++ b/server/internal/websocket/control.go @@ -31,13 +31,9 @@ func (h *MessageHandler) controlRelease(id string, session types.Session) error return nil } -func (h *MessageHandler) controlRequest(id string, session types.Session, payload *message.ControlRequest) error { +func (h *MessageHandler) controlRequest(id string, session types.Session) error { // check for host if !h.sessions.HasHost() { - // keyboard layout change - h.logger.Debug().Msgf("change keyboard to %s", payload.KeyboardLayout) - h.remote.SetKeyboard(payload.KeyboardLayout) - // set host h.sessions.SetHost(id) diff --git a/server/internal/websocket/handler.go b/server/internal/websocket/handler.go index 25b043e..5693c97 100644 --- a/server/internal/websocket/handler.go +++ b/server/internal/websocket/handler.go @@ -76,11 +76,7 @@ func (h *MessageHandler) Message(id string, raw []byte) error { case event.CONTROL_RELEASE: return errors.Wrapf(h.controlRelease(id, session), "%s failed", header.Event) case event.CONTROL_REQUEST: - payload := &message.ControlRequest{} - return errors.Wrapf( - utils.Unmarshal(payload, raw, func() error { - return h.controlRequest(id, session, payload) - }), "%s failed", header.Event) + return errors.Wrapf(h.controlRequest(id, session), "%s failed", header.Event) case event.CONTROL_GIVE: payload := &message.Control{} return errors.Wrapf(