aboutsummaryrefslogtreecommitdiff
path: root/server.go
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2020-10-04 21:20:22 +0200
committerAlex Auvolat <alex@adnab.me>2020-10-04 21:20:22 +0200
commit07f9f640f0f18541760adb8746cd563a504d6609 (patch)
tree5e8bc029ace33b826d63546677096a65fc570732 /server.go
parent7130c7b7d6d0c4f49229df33825e2861eb463457 (diff)
downloadeasybridge-07f9f640f0f18541760adb8746cd563a504d6609.tar.gz
easybridge-07f9f640f0f18541760adb8746cd563a504d6609.zip
Looks like 2FA works in facebook messenger :o
Diffstat (limited to 'server.go')
-rw-r--r--server.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/server.go b/server.go
index e81f0b3..2ed598e 100644
--- a/server.go
+++ b/server.go
@@ -259,6 +259,7 @@ func handleSystemMessage(mxid string, msg string) {
ezbrSystemSend(mxid, "- join <protocol or account> <room id>: join public chat room")
ezbrSystemSend(mxid, "- talk <protocol or account> <user id>: open private conversation to contact")
ezbrSystemSend(mxid, "- search <protocol or account> <name>: search for users by name")
+ ezbrSystemSend(mxid, "- cmd <protocol or account> <command>: send special command to account")
case "list", "account", "accounts":
one := false
if accts, ok := registeredAccounts[mxid]; ok {
@@ -332,6 +333,18 @@ func handleSystemMessage(mxid string, msg string) {
} else {
ezbrSystemSendf(mxid, "No account with name or using protocol %s", cmd[1])
}
+ case "cmd":
+ if len(cmd) < 3 {
+ ezbrSystemSendf(mxid, "Usage: %s <protocol or account> <name>", cmd[0])
+ return
+ }
+
+ account := findAccount(mxid, cmd[1])
+ if account != nil {
+ account.Conn.UserCommand(strings.Join(cmd[2:], " "))
+ } else {
+ ezbrSystemSendf(mxid, "No account with name or using protocol %s", cmd[1])
+ }
default:
ezbrSystemSend(mxid, "Unrecognized command. Type `help` if you need some help!")
}