Fixed some logic errors and initialized some things that needed to be initialized.
--- a/xmpp/roster.go Sun Sep 08 14:37:56 2013 -0700
+++ b/xmpp/roster.go Sun Sep 08 14:40:35 2013 -0700
@@ -59,6 +59,9 @@
f()
}
iq, ok := stan.(*Iq)
+ if !ok {
+ continue
+ }
if iq.Type != "set" {
continue
}
--- a/xmpp/xmpp.go Sun Sep 08 14:37:56 2013 -0700
+++ b/xmpp/xmpp.go Sun Sep 08 14:40:35 2013 -0700
@@ -143,6 +143,8 @@
cl.handlers = make(chan *stanzaHandler, 100)
cl.inputControl = make(chan int)
cl.tlsConfig = tlsconf
+ cl.sendFilterAdd = make(chan Filter)
+ cl.recvFilterAdd = make(chan Filter)
extStanza := make(map[xml.Name]reflect.Type)
for _, ext := range exts {
@@ -182,7 +184,12 @@
go filterMgr(cl.recvFilterAdd, recvRawXmpp, recvFiltXmpp)
sendFiltXmpp := make(chan Stanza)
cl.Send = sendFiltXmpp
- go filterMgr(cl.sendFilterAdd, sendFiltXmpp, sendFiltXmpp)
+ go filterMgr(cl.sendFilterAdd, sendFiltXmpp, sendRawXmpp)
+ // Set up the initial filters.
+ for _, ext := range exts {
+ cl.AddRecvFilter(ext.RecvFilter)
+ cl.AddSendFilter(ext.SendFilter)
+ }
// Initial handshake.
hsOut := &stream{To: jid.Domain, Version: XMPPVersion}