mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
join plain text and rich text to one struct.
This commit is contained in:
@ -16,5 +16,8 @@ func (h *MessageHandlerCtx) clipboardSet(session types.Session, payload *message
|
||||
return nil
|
||||
}
|
||||
|
||||
return h.desktop.ClipboardSetPlainText(payload.Text)
|
||||
return h.desktop.ClipboardSetText(types.ClipboardText{
|
||||
Text: payload.Text,
|
||||
// TODO: Send HTML?
|
||||
})
|
||||
}
|
||||
|
@ -117,14 +117,15 @@ func (ws *WebSocketManagerCtx) Start() {
|
||||
return
|
||||
}
|
||||
|
||||
text, err := ws.desktop.ClipboardGetPlainText()
|
||||
data, err := ws.desktop.ClipboardGetText()
|
||||
if err != nil {
|
||||
ws.logger.Warn().Err(err).Msg("could not get clipboard content")
|
||||
}
|
||||
|
||||
if err := session.Send(message.ClipboardData{
|
||||
Event: event.CLIPBOARD_UPDATED,
|
||||
Text: text,
|
||||
Text: data.Text,
|
||||
// TODO: Send HTML?
|
||||
}); err != nil {
|
||||
ws.logger.Warn().Err(err).Msg("could not sync clipboard")
|
||||
}
|
||||
|
Reference in New Issue
Block a user