mirror of
https://github.com/m1k1o/neko.git
synced 2025-06-23 13:08:03 +02:00
Implicit control gain (#108)
* add client side implicit hosting. * add server side implicit hosting. * update changelog. * allow clipboard & keybaord access.
This commit is contained in:
parent
f08ed0fc28
commit
7d1fa28d88
21 changed files with 125 additions and 38 deletions
|
@ -125,9 +125,9 @@ func (h *MessageHandler) controlGive(id string, session types.Session, payload *
|
|||
}
|
||||
|
||||
func (h *MessageHandler) controlClipboard(id string, session types.Session, payload *message.Clipboard) error {
|
||||
// check if session is host
|
||||
if !h.sessions.IsHost(id) {
|
||||
h.logger.Debug().Str("id", id).Msg("is not the host")
|
||||
// check if session can access clipboard
|
||||
if (!h.webrtc.ImplicitControl() && !h.sessions.IsHost(id)) || (h.webrtc.ImplicitControl() && !h.sessions.CanControl(id)) {
|
||||
h.logger.Debug().Str("id", id).Msg("cannot access clipboard")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -136,9 +136,9 @@ func (h *MessageHandler) controlClipboard(id string, session types.Session, payl
|
|||
}
|
||||
|
||||
func (h *MessageHandler) controlKeyboard(id string, session types.Session, payload *message.Keyboard) error {
|
||||
// check if session is host
|
||||
if !h.sessions.IsHost(id) {
|
||||
h.logger.Debug().Str("id", id).Msg("is not the host")
|
||||
// check if session can control keyboard
|
||||
if (!h.webrtc.ImplicitControl() && !h.sessions.IsHost(id)) || (h.webrtc.ImplicitControl() && !h.sessions.CanControl(id)) {
|
||||
h.logger.Debug().Str("id", id).Msg("cannot control keyboard")
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue