diff -r a8f9a0c07fc8 -r 8342afcffc92 xmpp/structs.go --- a/xmpp/structs.go Sat Sep 07 10:30:22 2013 -0700 +++ b/xmpp/structs.go Sat Sep 07 11:19:29 2013 -0700 @@ -13,6 +13,7 @@ "fmt" // BUG(cjyar): Doesn't use stringprep. Could try the implementation at // "code.google.com/p/go-idn/src/stringprep" + "reflect" "regexp" "strings" ) @@ -269,8 +270,10 @@ return string(buf) } -var bindExt Extension = Extension{StanzaHandlers: map[string]func(*xml.Name) interface{}{NsBind: newBind}} +var bindExt Extension = Extension{} -func newBind(name *xml.Name) interface{} { - return &bindIq{} +func init() { + bindExt.StanzaHandlers = make(map[xml.Name]reflect.Type) + bName := xml.Name{Space: NsBind, Local: "bind"} + bindExt.StanzaHandlers[bName] = reflect.TypeOf(bindIq{}) }