mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
+ CanAccessClipboard.
This commit is contained in:
parent
5edd9dc97a
commit
e17e2cb606
@ -6,6 +6,11 @@ import (
|
||||
)
|
||||
|
||||
func (h *MessageHandlerCtx) clipboardSet(session types.Session, payload *message.ClipboardData) error {
|
||||
if !session.CanAccessClipboard() {
|
||||
h.logger.Debug().Str("id", session.ID()).Msg("cannot access clipboard")
|
||||
return nil
|
||||
}
|
||||
|
||||
if !session.IsHost() {
|
||||
h.logger.Debug().Str("id", session.ID()).Msg("is not the host")
|
||||
return nil
|
||||
|
@ -121,6 +121,11 @@ func (ws *WebSocketManagerCtx) Start() {
|
||||
break
|
||||
}
|
||||
|
||||
current = text
|
||||
if !session.CanAccessClipboard() {
|
||||
break
|
||||
}
|
||||
|
||||
if err := session.Send(
|
||||
message.ClipboardData{
|
||||
Event: event.CLIPBOARD_UPDATED,
|
||||
@ -128,8 +133,6 @@ func (ws *WebSocketManagerCtx) Start() {
|
||||
}); err != nil {
|
||||
ws.logger.Warn().Err(err).Msg("could not sync clipboard")
|
||||
}
|
||||
|
||||
current = text
|
||||
}
|
||||
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
Loading…
Reference in New Issue
Block a user