diff -r 33e7f25f1fd2 -r c8c9e6a7e6c9 structs.go --- a/structs.go Sat Dec 31 12:11:02 2011 -0700 +++ b/structs.go Sun Jan 01 17:19:03 2012 -0700 @@ -55,7 +55,7 @@ type Features struct { Starttls *starttls Mechanisms mechs - Bind *Generic + Bind *bindIq Session *Generic Any *Generic } @@ -163,6 +163,13 @@ var _ xml.Marshaler = &Error{} var _ os.Error = &Error{} +// Used for resource binding as a nested element inside . +type bindIq struct { + XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-bind bind"` + Resource *string `xml:"resource"` + Jid *string `xml:"jid"` +} + // Holds an XML element not described by the more specific types. type Generic struct { XMLName xml.Name @@ -538,3 +545,7 @@ } return stan, nil } + +func newBind(name *xml.Name) interface{} { + return &bindIq{} +}