diff options
-rw-r--r-- | xmpp/iq.go | 10 | ||||
-rw-r--r-- | xmpp/routing.go | 6 |
2 files changed, 6 insertions, 10 deletions
@@ -47,13 +47,9 @@ func (s *session) sendBind() { } } -type iqResponse struct { - Jid string `xml:"urn:ietf:params:xml:ns:xmpp-bind bind>jid"` -} - -func handleIqResponse(s *session, i iqResponse) { - if i.Jid != "" { - s.jid = i.Jid +func handleIq(s *session, i iq) { + if i.Bind.Jid != "" { + s.jid = i.Bind.Jid s.sendPresence() return } diff --git a/xmpp/routing.go b/xmpp/routing.go index 2f2347a..df45451 100644 --- a/xmpp/routing.go +++ b/xmpp/routing.go @@ -12,7 +12,7 @@ func route(s *xml.StartElement, d *xml.Decoder, c chan<- any) { case xml.Name{`urn:ietf:params:xml:ns:xmpp-sasl`, `success`}: parse(saslSuccess{}, s, d, c) case xml.Name{`jabber:client`, `iq`}: - parse(iqResponse{}, s, d, c) + parse(iq{}, s, d, c) case xml.Name{`jabber:client`, `message`}: parse(message{}, s, d, c) default: @@ -35,8 +35,8 @@ func handle(s *session, element any) { handleStreamFeatures(s, t) case saslSuccess: handleSaslSuccess(s) - case iqResponse: - handleIqResponse(s, t) + case iq: + handleIq(s, t) case message: handleMessage(s, t) default: |