|
|
|
@ -300,7 +300,8 @@ func (*Node) IsIQPayload() {}
|
|
|
|
|
// Disco
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
NSDiscoInfo = "http://jabber.org/protocol/disco#info"
|
|
|
|
|
NSDiscoInfo = "http://jabber.org/protocol/disco#info"
|
|
|
|
|
NSDiscoItems = "http://jabber.org/protocol/disco#items"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type DiscoInfo struct {
|
|
|
|
@ -325,10 +326,28 @@ type Feature struct {
|
|
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
type DiscoItems struct {
|
|
|
|
|
XMLName xml.Name `xml:"http://jabber.org/protocol/disco#items query"`
|
|
|
|
|
Node string `xml:"node,attr,omitempty"`
|
|
|
|
|
Items []DiscoItem `xml:"item"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (*DiscoItems) IsIQPayload() {}
|
|
|
|
|
|
|
|
|
|
type DiscoItem struct {
|
|
|
|
|
XMLName xml.Name `xml:"item"`
|
|
|
|
|
Name string `xml:"name,attr,omitempty"`
|
|
|
|
|
JID string `xml:"jid,attr,omitempty"`
|
|
|
|
|
Node string `xml:"node,attr,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ============================================================================
|
|
|
|
|
|
|
|
|
|
var typeRegistry = make(map[string]reflect.Type)
|
|
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
|
typeRegistry["http://jabber.org/protocol/disco#info query"] = reflect.TypeOf(DiscoInfo{})
|
|
|
|
|
typeRegistry["http://jabber.org/protocol/disco#items query"] = reflect.TypeOf(DiscoItems{})
|
|
|
|
|
typeRegistry["urn:ietf:params:xml:ns:xmpp-bind bind"] = reflect.TypeOf(BindBind{})
|
|
|
|
|
typeRegistry["urn:xmpp:iot:control set"] = reflect.TypeOf(iot.ControlSet{})
|
|
|
|
|
}
|
|
|
|
|