diff options
Diffstat (limited to 'xmpp/iq.go')
-rw-r--r-- | xmpp/iq.go | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -3,24 +3,24 @@ package xmpp import ( "encoding/xml" "fmt" - "math/rand" "log" + "math/rand" ) type iqRx struct { XMLName xml.Name `xml:"jabber:client iq"` - Type string `xml:"type,attr"` - Id string `xml:"id,attr"` - Bind struct{ + Type string `xml:"type,attr"` + Id string `xml:"id,attr"` + Bind struct { Jid string `xml:"jid"` } `xml:"urn:ietf:params:xml:ns:xmpp-bind bind"` Query []RosterItem `xml:"jabber:iq:roster query>item"` } type RosterItem struct { - Jid string `xml:"jid,attr"` + Jid string `xml:"jid,attr"` Subscription string `xml:"subscription,attr"` - Name string `xml:"name,attr"` + Name string `xml:"name,attr"` } func (i iqRx) handle(s *session) { @@ -41,9 +41,9 @@ func (i iqRx) handle(s *session) { type bindSet struct { XMLName xml.Name `xml:"jabber:client iq"` - Type string `xml:"type,attr,omitempty"` - Id string `xml:"id,attr,omitempty"` - Bind struct{ + Type string `xml:"type,attr,omitempty"` + Id string `xml:"id,attr,omitempty"` + Bind struct { Resource string `xml:"resource,omitempty"` } `xml:"urn:ietf:params:xml:ns:xmpp-bind bind,omitempty"` } @@ -64,9 +64,9 @@ func (s *session) sendBind() { type rosterGet struct { XMLName xml.Name `xml:"jabber:client iq"` - Type string `xml:"type,attr,omitempty"` - Id string `xml:"id,attr,omitempty"` - Query string `xml:"jabber:iq:roster query"` + Type string `xml:"type,attr,omitempty"` + Id string `xml:"id,attr,omitempty"` + Query string `xml:"jabber:iq:roster query"` } func (s *session) sendRosterGet() { |