Example #1
0
func init() {
	features.FeatureFactory.Add("bind", &features.FeatureFactoryElement{
		Constructor: func(opts features.Options) *features.Feature {
			return features.NewFeature("bind", &bindElement{}, true, nil)
		},
		Name:   xml.Name{Local: "bind", Space: "urn:ietf:params:xml:ns:xmpp-bind"},
		Parent: iq.IQXMLName,
		Wants:  []string{"auth"},
	})
}
Example #2
0
func init() {
	features.FeatureFactory.Add("auth", &features.FeatureFactoryElement{
		Constructor: func(opts features.Options) *features.Feature {
			conf := *opts.(*AuthConfig)
			return features.NewFeature("auth", newMechanismsElement(conf), true, conf)
		},
		Name:   xml.Name{Local: "auth"},
		Parent: stream.StreamXMLName,
		Config: func() interface{} { return &AuthConfig{} },
	})
}
Example #3
0
func init() {
	features.FeatureFactory.Add("compression", &features.FeatureFactoryElement{
		Constructor: func(opts features.Options) *features.Feature {
			conf := *opts.(*CompressionConfig)
			return features.NewFeature("compression", NewCompression(conf), false, conf)
		},
		Name:   xml.Name{Local: "compress"},
		Parent: stream.StreamXMLName,
		Config: func() interface{} { return &CompressionConfig{} },
	})
}
Example #4
0
func init() {
	features.FeatureFactory.Add(
		"starttls",
		&features.FeatureFactoryElement{
			Constructor: func(opts features.Options) *features.Feature {
				conf := opts.(*startTLSConf)
				return features.NewFeature("starttls", NewStartTLSFeature(conf), false, conf)
			},
			Name:   xml.Name{Local: "starttls", Space: "urn:ietf:params:xml:ns:xmpp-tls"},
			Parent: stream.StreamXMLName,
			Config: func() interface{} { return &startTLSConf{} },
		},
	)
}