aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPascal Abresch <neplevitan@packageloss.eu>2019-03-19 15:58:57 +0100
committerPascal Abresch <neplevitan@packageloss.eu>2019-03-19 15:58:57 +0100
commite9b76ccfec15ecab21c10f5a0133528526e856f7 (patch)
tree990f48dfc2d5682aea0fe6f23e381da2f8c644ea
parent576de5264e4d481467e3019ebe7d23a7a7c9a0af (diff)
adds /msetstate
-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 dffd7e9..b18f950 100644
--- a/ui/command-processor.go
+++ b/ui/command-processor.go
@@ -80,6 +80,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
"send": {"sendevent"},
"msend": {"msendevent"},
"state": {"setstate"},
+ "mstate":{"msetstate"},
"rb": {"rainbow"},
},
commands: map[string]CommandHandler{
@@ -95,6 +96,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
"sendevent": cmdSendEvent,
"msendevent": cmdMSendEvent,
"setstate": cmdSetState,
+ "msetstate": cmdMSetState,
"rainbow": cmdRainbow,
},
}
diff --git a/ui/commands.go b/ui/commands.go
index 39b1a46..7175a21 100644
--- a/ui/commands.go
+++ b/ui/commands.go
@@ -167,6 +167,15 @@ func cmdSendEvent(cmd *Command) {
}
}
+func cmdMSetState(cmd *Command) {
+ if len(cmd.Args) < 2 {
+ cmd.Reply("Usage: /msetstate <event type> <state key> <content>")
+ return
+ }
+ cmd.Args = append([]string{cmd.Room.MxRoom().ID},cmd.Args...)
+ cmdSetState(cmd)
+}
+
func cmdSetState(cmd *Command) {
if len(cmd.Args) < 4 {
cmd.Reply("Usage: /setstate <room id> <event type> <state key/`-`> <content>")