stream.go
changeset 33 571713f49494
parent 32 4e68d8f89dc3
child 34 7b1f924c75e2
equal deleted inserted replaced
32:4e68d8f89dc3 33:571713f49494
   549 }
   549 }
   550 
   550 
   551 // Register a callback to handle the next XMPP stanza (iq, message, or
   551 // Register a callback to handle the next XMPP stanza (iq, message, or
   552 // presence) with a given id. The provided function will not be called
   552 // presence) with a given id. The provided function will not be called
   553 // more than once. If it returns false, the stanza will not be made
   553 // more than once. If it returns false, the stanza will not be made
   554 // available on the normal Client.In channel.
   554 // available on the normal Client.In channel. The stanza handler
       
   555 // must not read from that channel, as deliveries on it cannot proceed
       
   556 // until the handler returns true or false.
   555 func (cl *Client) HandleStanza(id string, f func(Stanza) bool) {
   557 func (cl *Client) HandleStanza(id string, f func(Stanza) bool) {
   556 	h := &stanzaHandler{id: id, f: f}
   558 	h := &stanzaHandler{id: id, f: f}
   557 	cl.handlers <- h
   559 	cl.handlers <- h
   558 }
   560 }