xmpp/layer3.go
changeset 149 22c96a9ab289
parent 148 b1b4900eee5b
child 150 fa7f6ff10c67
equal deleted inserted replaced
148:b1b4900eee5b 149:22c96a9ab289
   117 		cl.chooseSasl(fe)
   117 		cl.chooseSasl(fe)
   118 		return
   118 		return
   119 	}
   119 	}
   120 
   120 
   121 	if fe.Bind != nil {
   121 	if fe.Bind != nil {
   122 		cl.bind(fe.Bind)
   122 		cl.bind()
   123 		return
   123 		return
   124 	}
   124 	}
   125 }
   125 }
   126 
   126 
   127 func (cl *Client) handleTls(t *starttls) {
   127 func (cl *Client) handleTls(t *starttls) {
   142 	h := &callback{id: id, f: f}
   142 	h := &callback{id: id, f: f}
   143 	cl.handlers <- h
   143 	cl.handlers <- h
   144 }
   144 }
   145 
   145 
   146 // Send a request to bind a resource. RFC 3920, section 7.
   146 // Send a request to bind a resource. RFC 3920, section 7.
   147 func (cl *Client) bind(bindAdv *bindIq) {
   147 func (cl *Client) bind() {
   148 	res := cl.Jid.Resource
   148 	res := cl.Jid.Resource
   149 	bindReq := &bindIq{}
   149 	bindReq := &bindIq{}
   150 	if res != "" {
   150 	if res != "" {
   151 		bindReq.Resource = &res
   151 		bindReq.Resource = &res
   152 	}
   152 	}