mirror of
https://github.com/m1k1o/neko.git
synced 2025-07-13 14:58:00 +02:00
move server to server directory.
This commit is contained in:
parent
da45f62ca8
commit
cfb423b13d
211 changed files with 18 additions and 10 deletions
23
server/internal/websocket/handler/clipboard.go
Normal file
23
server/internal/websocket/handler/clipboard.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package handler
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/demodesk/neko/pkg/types"
|
||||
"github.com/demodesk/neko/pkg/types/message"
|
||||
)
|
||||
|
||||
func (h *MessageHandlerCtx) clipboardSet(session types.Session, payload *message.ClipboardData) error {
|
||||
if !session.Profile().CanAccessClipboard {
|
||||
return errors.New("cannot access clipboard")
|
||||
}
|
||||
|
||||
if !session.IsHost() {
|
||||
return errors.New("is not the host")
|
||||
}
|
||||
|
||||
return h.desktop.ClipboardSetText(types.ClipboardText{
|
||||
Text: payload.Text,
|
||||
// TODO: Send HTML?
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue