xmpp/xmpp.go
changeset 141 f0d0f3b941a6
parent 138 065f54e291c7
child 142 0ff033eed887
equal deleted inserted replaced
140:f94b958f8df0 141:f0d0f3b941a6
   235 func (cl *Client) bindDone() {
   235 func (cl *Client) bindDone() {
   236 	cl.inputControl <- 1
   236 	cl.inputControl <- 1
   237 }
   237 }
   238 
   238 
   239 // Start an XMPP session. A typical XMPP client should call this
   239 // Start an XMPP session. A typical XMPP client should call this
   240 // immediately after creating the Client in order to start the
   240 // immediately after creating the Client in order to start the session
   241 // session, retrieve the roster, and broadcast an initial
   241 // and broadcast an initial presence. The presence can be as simple as
   242 // presence. The presence can be as simple as a newly-initialized
   242 // a newly-initialized Presence struct.  See RFC 3921, Section
   243 // Presence struct.  See RFC 3921, Section 3. After calling this, a
   243 // 3. After calling this, a normal client should call Roster.Update().
   244 // normal client will want to call Roster.Update().
       
   245 func (cl *Client) StartSession(pr *Presence) error {
   244 func (cl *Client) StartSession(pr *Presence) error {
   246 	id := NextId()
   245 	id := NextId()
   247 	iq := &Iq{Header: Header{To: cl.Jid.Domain, Id: id, Type: "set",
   246 	iq := &Iq{Header: Header{To: cl.Jid.Domain, Id: id, Type: "set",
   248 		Nested: []interface{}{Generic{XMLName: xml.Name{Space: NsSession, Local: "session"}}}}}
   247 		Nested: []interface{}{Generic{XMLName: xml.Name{Space: NsSession, Local: "session"}}}}}
   249 	ch := make(chan error)
   248 	ch := make(chan error)