aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorPascal Abresch <neplevitan@packageloss.eu>2019-03-19 15:57:50 +0100
committerPascal Abresch <neplevitan@packageloss.eu>2019-03-19 15:57:50 +0100
commit576de5264e4d481467e3019ebe7d23a7a7c9a0af (patch)
treecfe4011ead8871effb95e76c5ff2576e92a2ade2 /ui
parent01523ae8cee20695eb6e9d0c4ecd705c6a317baa (diff)
adds /msend
Diffstat (limited to 'ui')
-rw-r--r--ui/command-processor.go2
-rw-r--r--ui/commands.go9
2 files changed, 11 insertions, 0 deletions
diff --git a/ui/command-processor.go b/ui/command-processor.go
index 0aed4b2..dffd7e9 100644
--- a/ui/command-processor.go
+++ b/ui/command-processor.go
@@ -78,6 +78,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
aliases: map[string]*Alias{
"part": {"leave"},
"send": {"sendevent"},
+ "msend": {"msendevent"},
"state": {"setstate"},
"rb": {"rainbow"},
},
@@ -92,6 +93,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
"toggle": cmdToggle,
"logout": cmdLogout,
"sendevent": cmdSendEvent,
+ "msendevent": cmdMSendEvent,
"setstate": cmdSetState,
"rainbow": cmdRainbow,
},
diff --git a/ui/commands.go b/ui/commands.go
index 12a99de..39b1a46 100644
--- a/ui/commands.go
+++ b/ui/commands.go
@@ -129,6 +129,15 @@ func cmdJoin(cmd *Command) {
}
}
+func cmdMSendEvent(cmd *Command) {
+ if len(cmd.Args) < 2 {
+ cmd.Reply("Usage: /msend <event type> <content>")
+ return
+ }
+ cmd.Args = append([]string{cmd.Room.MxRoom().ID},cmd.Args...)
+ cmdSendEvent(cmd)
+}
+
func cmdSendEvent(cmd *Command) {
debug.Print(cmd.Command, cmd.Args, len(cmd.Args))
if len(cmd.Args) < 3 {