22 lines
493 B
Go
Raw Normal View History

2020-11-30 17:40:38 +01:00
package handler
import (
"demodesk/neko/internal/types"
"demodesk/neko/internal/types/message"
)
func (h *MessageHandlerCtx) clipboardSet(session types.Session, payload *message.ClipboardData) error {
2020-12-06 18:55:24 +01:00
if !session.CanAccessClipboard() {
h.logger.Debug().Str("id", session.ID()).Msg("cannot access clipboard")
return nil
}
2020-11-30 17:40:38 +01:00
if !session.IsHost() {
h.logger.Debug().Str("id", session.ID()).Msg("is not the host")
return nil
}
h.desktop.WriteClipboard(payload.Text)
return nil
}