xmpp/structs.go
changeset 128 8342afcffc92
parent 126 367e76b3028e
child 142 0ff033eed887
equal deleted inserted replaced
127:a8f9a0c07fc8 128:8342afcffc92
    11 	"encoding/xml"
    11 	"encoding/xml"
    12 	"flag"
    12 	"flag"
    13 	"fmt"
    13 	"fmt"
    14 	// BUG(cjyar): Doesn't use stringprep. Could try the implementation at
    14 	// BUG(cjyar): Doesn't use stringprep. Could try the implementation at
    15 	// "code.google.com/p/go-idn/src/stringprep"
    15 	// "code.google.com/p/go-idn/src/stringprep"
       
    16 	"reflect"
    16 	"regexp"
    17 	"regexp"
    17 	"strings"
    18 	"strings"
    18 )
    19 )
    19 
    20 
    20 // JID represents an entity that can communicate with other
    21 // JID represents an entity that can communicate with other
   267 		return "unreadable error"
   268 		return "unreadable error"
   268 	}
   269 	}
   269 	return string(buf)
   270 	return string(buf)
   270 }
   271 }
   271 
   272 
   272 var bindExt Extension = Extension{StanzaHandlers: map[string]func(*xml.Name) interface{}{NsBind: newBind}}
   273 var bindExt Extension = Extension{}
   273 
   274 
   274 func newBind(name *xml.Name) interface{} {
   275 func init() {
   275 	return &bindIq{}
   276 	bindExt.StanzaHandlers = make(map[xml.Name]reflect.Type)
   276 }
   277 	bName := xml.Name{Space: NsBind, Local: "bind"}
       
   278 	bindExt.StanzaHandlers[bName] = reflect.TypeOf(bindIq{})
       
   279 }