Fixed some logic errors and initialized some things that needed to be initialized.
packagexmpp// Manages the stack of filters that can read and modify stanzas on// their way from the remote to the application.// Receive new filters on filterAdd; those new filters get added to// the top of the stack. Receive stanzas at the bottom of the stack on// input. Send stanzas out the top of the stack on output.funcfilterMgr(filterAdd<-chanFilter,input<-chanStanza,outputchan<-Stanza){botFiltIn:=outputtopFiltOut:=inputloop:for{select{casestan,ok:=<-input:if!ok{breakloop}botFiltIn<-stancasestan,ok:=<-topFiltOut:if!ok{breakloop}output<-stancasefilt:=<-filterAdd:newTop:=make(chanStanza)gofilt(topFiltOut,newTop)topFiltOut=newTop}}close(botFiltIn)}// AddRecvFilter adds a new filter to the top of the stack through which// incoming stanzas travel on their way up to the client.func(cl*Client)AddRecvFilter(filtFilter){iffilt==nil{return}cl.recvFilterAdd<-filt}// AddSendFilter adds a new filter to the top of the stack through// which outgoing stanzas travel on their way down from the client to// the network.func(cl*Client)AddSendFilter(filtFilter){iffilt==nil{return}cl.sendFilterAdd<-filt}