Don't forget to remove the stanza handler after it's been used.
--- a/stream.go Wed Dec 28 11:30:10 2011 -0700
+++ b/stream.go Wed Dec 28 11:35:21 2011 -0700
@@ -200,6 +200,7 @@
if st, ok := x.(Stanza) ; ok &&
handlers[st.XId()] != nil {
f := handlers[st.XId()]
+ handlers[st.XId()] = nil
send = f(st)
}
if send {
@@ -475,7 +476,6 @@
"resource"}, Chardata: res}
}
cl.xmlOut <- msg
- // TODO Grab the iq result from the server and update cl.Jid.
}
func (cl *Client) HandleStanza(id string, f func(Stanza) bool) {