stream.go
changeset 30 a77fc342e013
parent 29 a456133ed0ac
child 31 1dc47df5c99f
equal deleted inserted replaced
29:a456133ed0ac 30:a77fc342e013
   495 }
   495 }
   496 
   496 
   497 // Send a request to bind a resource. RFC 3920, section 7.
   497 // Send a request to bind a resource. RFC 3920, section 7.
   498 func (cl *Client) bind(bind *Generic) {
   498 func (cl *Client) bind(bind *Generic) {
   499 	res := cl.Jid.Resource
   499 	res := cl.Jid.Resource
   500 	msg := &Iq{Type: "set", Id: cl.NextId(), Any:
   500 	msg := &Iq{Type: "set", Id: <- cl.Id, Any:
   501 		&Generic{XMLName: xml.Name{Space: nsBind, Local:
   501 		&Generic{XMLName: xml.Name{Space: nsBind, Local:
   502 					"bind"}}}
   502 					"bind"}}}
   503 	if res != "" {
   503 	if res != "" {
   504 		msg.Any.Any = &Generic{XMLName: xml.Name{Local:
   504 		msg.Any.Any = &Generic{XMLName: xml.Name{Local:
   505 				"resource"}, Chardata: res}
   505 				"resource"}, Chardata: res}