mirror of https://github.com/FluuxIO/go-xmpp
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
758 B
Go
41 lines
758 B
Go
5 years ago
|
package stanza
|
||
5 years ago
|
|
||
|
import (
|
||
|
"encoding/xml"
|
||
|
)
|
||
|
|
||
|
type PubSub struct {
|
||
|
XMLName xml.Name `xml:"http://jabber.org/protocol/pubsub pubsub"`
|
||
5 years ago
|
Publish *Publish
|
||
|
Retract *Retract
|
||
5 years ago
|
// TODO <configure/>
|
||
|
}
|
||
|
|
||
|
func (p *PubSub) Namespace() string {
|
||
|
return p.XMLName.Space
|
||
|
}
|
||
|
|
||
|
type Publish struct {
|
||
|
XMLName xml.Name `xml:"publish"`
|
||
|
Node string `xml:"node,attr"`
|
||
|
Item Item
|
||
|
}
|
||
|
|
||
|
type Item struct {
|
||
|
XMLName xml.Name `xml:"item"`
|
||
|
Id string `xml:"id,attr,omitempty"`
|
||
5 years ago
|
Tune *Tune
|
||
|
Mood *Mood
|
||
5 years ago
|
}
|
||
|
|
||
|
type Retract struct {
|
||
|
XMLName xml.Name `xml:"retract"`
|
||
|
Node string `xml:"node,attr"`
|
||
|
Notify string `xml:"notify,attr"`
|
||
|
Item Item
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
TypeRegistry.MapExtension(PKTIQ, xml.Name{"http://jabber.org/protocol/pubsub", "pubsub"}, PubSub{})
|
||
|
}
|