mirror of
https://github.com/m1k1o/neko.git
synced 2025-08-02 08:19:14 +02:00
clipboard sync and some minor fixes
This commit is contained in:
parent
e3a73aa264
commit
56a5dcf77f
22 changed files with 359 additions and 88 deletions
|
@ -1,6 +1,7 @@
|
|||
package websocket
|
||||
|
||||
import (
|
||||
"n.eko.moe/neko/internal/hid/clipboard"
|
||||
"n.eko.moe/neko/internal/types"
|
||||
"n.eko.moe/neko/internal/types/event"
|
||||
"n.eko.moe/neko/internal/types/message"
|
||||
|
@ -104,3 +105,14 @@ func (h *MessageHandler) controlGive(id string, session types.Session, payload *
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
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")
|
||||
return nil
|
||||
}
|
||||
|
||||
clipboard.WriteAll(payload.Text)
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue