mirror of
https://github.com/m1k1o/neko.git
synced 2025-04-29 02:16:21 +02:00
23 lines
504 B
Go
23 lines
504 B
Go
package handler
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/m1k1o/neko/server/pkg/types"
|
|
"github.com/m1k1o/neko/server/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?
|
|
})
|
|
}
|