# HG changeset patch # User Chris Jones # Date 1378676435 25200 # Node ID 80b764fa2f0884565be3eda06d5022b41fd39a33 # Parent c4e0b897db835ce8b42836ad2a73a270ddbe2926 Fixed some logic errors and initialized some things that needed to be initialized. diff -r c4e0b897db83 -r 80b764fa2f08 xmpp/roster.go --- 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 } diff -r c4e0b897db83 -r 80b764fa2f08 xmpp/xmpp.go --- 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}