diff options
Diffstat (limited to 'ui/commands.go')
-rw-r--r-- | ui/commands.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ui/commands.go b/ui/commands.go index 4dd1482..27c9caf 100644 --- a/ui/commands.go +++ b/ui/commands.go @@ -34,6 +34,7 @@ import ( "github.com/lucasb-eyer/go-colorful" "github.com/russross/blackfriday/v2" + "github.com/atotto/clipboard" "maunium.net/go/mautrix" "maunium.net/go/mautrix/event" @@ -158,6 +159,7 @@ const ( SelectRedact = "redact" SelectDownload = "download" SelectOpen = "open" + SelectCopy = "copy" ) func cmdReply(cmd *Command) { @@ -176,6 +178,14 @@ func cmdOpen(cmd *Command) { cmd.Room.StartSelecting(SelectOpen, strings.Join(cmd.Args, " ")) } +func cmdCopy(cmd *Command) { + if clipboard.Unsupported { + cmd.Reply("Clipboard unsupported.") + } else { + cmd.Room.StartSelecting(SelectCopy, strings.Join(cmd.Args, " ")) + } +} + func cmdReact(cmd *Command) { if len(cmd.Args) == 0 { cmd.Reply("Usage: /react <reaction>") |