structs.go
changeset 41 c8c9e6a7e6c9
parent 40 33e7f25f1fd2
child 42 f6bb47ca12f2
--- 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 <iq/>.
+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{}
+}