diff options
author | Alex Auvolat <alex@adnab.me> | 2020-10-04 21:20:22 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-10-04 21:20:22 +0200 |
commit | 07f9f640f0f18541760adb8746cd563a504d6609 (patch) | |
tree | 5e8bc029ace33b826d63546677096a65fc570732 /server.go | |
parent | 7130c7b7d6d0c4f49229df33825e2861eb463457 (diff) | |
download | easybridge-07f9f640f0f18541760adb8746cd563a504d6609.tar.gz easybridge-07f9f640f0f18541760adb8746cd563a504d6609.zip |
Looks like 2FA works in facebook messenger :o
Diffstat (limited to 'server.go')
-rw-r--r-- | server.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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!") } |