easybridge/connector/xmpp/iq.go
2020-02-17 18:11:34 +01:00

51 lines
1.1 KiB
Go

package xmpp
import (
"encoding/xml"
)
type DiscoQuery struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/disco#items query"`
Items []Node `xml:"item"`
}
type Node struct {
XMLName xml.Name `xml:"item"`
Jid string `xml:"jid,attr"`
Node string `xml:"node,attr"`
}
type PubSub struct {
XMLName xml.Name `xml:"http://jabber.org/protocol/pubsub pubsub"`
Subscribe []Subscribe `xml:"subscribe"`
Subscription []Subscription `xml:"subscription"`
Subscriptions []Subscription `xml:"subscriptions"`
Publish *Publish `xml:"publish"`
}
type Subscribe struct {
XMLName xml.Name `xml:"subscribe"`
Jid string `xml:"jid,attr"`
Node string `xml:"node,attr"`
}
type Subscription struct {
XMLName xml.Name `xml:"subscription"`
Jid string `xml:"jid,attr"`
Node string `xml:"node,attr"`
SubID string `xml:"subid,attr"`
Subscription string `xml:"subscription,attr"`
}
type Publish struct {
XMLName xml.Name `xml:"publish"`
Node string `xml:"node,attr"`
Item []Item `xml:"item"`
Items []Item `xml:"items"`
}
type Item struct {
XMLName xml.Name `xml:"publish"`
Id string `xml:"id,attr"`
Data string `xml:",innerxml"`
}