diff options
Diffstat (limited to 'xmpp/handlers.go')
-rw-r--r-- | xmpp/handlers.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xmpp/handlers.go b/xmpp/handlers.go index b4440a0..d68838b 100644 --- a/xmpp/handlers.go +++ b/xmpp/handlers.go @@ -88,8 +88,9 @@ func HandleMessage(s xmpp.Sender, p stanza.Packet) { if ok { session.ProcessOutgoingMessage(toID, msg.Body, msg.From) return - } else if msg.To == gatewayJid { - if strings.HasPrefix(msg.Body, "/") || strings.HasPrefix(msg.Body, "!") { + } else { + toJid, err := stanza.NewJid(msg.To) + if err == nil && toJid.Bare() == gatewayJid && (strings.HasPrefix(msg.Body, "/") || strings.HasPrefix(msg.Body, "!")) { response := session.ProcessTransportCommand(msg.Body, resource) if response != "" { gateway.SendMessage(msg.From, "", response, component) |