Fix ezbr kicking himself

This commit is contained in:
Alex 2020-02-17 21:12:30 +01:00
parent 31bba8d946
commit ad123342f7

View file

@ -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 {