diff options
author | Alex Auvolat <alex@adnab.me> | 2020-02-17 21:12:30 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2020-02-17 21:12:30 +0100 |
commit | ad123342f7ed0a0809b51189b59fe9a1ff2848ce (patch) | |
tree | 609f7e3f6a9ebe44938052ac0fc2d113a155ff91 /appservice | |
parent | 31bba8d946940df4858818f5efcc31cfd5a0a035 (diff) | |
download | easybridge-ad123342f7ed0a0809b51189b59fe9a1ff2848ce.tar.gz easybridge-ad123342f7ed0a0809b51189b59fe9a1ff2848ce.zip |
Fix ezbr kicking himself
Diffstat (limited to 'appservice')
-rw-r--r-- | appservice/server.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/appservice/server.go b/appservice/server.go index 33e095a..da01e07 100644 --- a/appservice/server.go +++ b/appservice/server.go @@ -85,8 +85,8 @@ func handleTxn(w http.ResponseWriter, r *http.Request) { for i := range txn.Events { ev := &txn.Events[i] - if ev.Sender == ezbrMxId() { - // Don't do anything with events originating from the system + if strings.HasPrefix(ev.Sender, "@" + registration.SenderLocalpart) { + // Don't do anything with ezbr events that come back to us continue } err = handleTxnEvent(ev) @@ -189,9 +189,7 @@ func handleSystemMessage(mxid string, msg string) { ezbrSystemSend(mxid, "- accounts: list accounts") ezbrSystemSend(mxid, "- join <protocol or account> <room id>: join public chat room") ezbrSystemSend(mxid, "- query <protocol or account> <user id>: open private buffer to contact") - case "list": - case "account": - case "accounts": + case "list", "account", "accounts": one := false if accts, ok := registeredAccounts[mxid]; ok { for name, acct := range accts { |