mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-24 11:32:00 -08:00
30 lines
709 B
Go
30 lines
709 B
Go
package xmpp // import "fluux.io/xmpp"
|
|
|
|
import "encoding/xml"
|
|
|
|
// ============================================================================
|
|
// Presence Packet
|
|
|
|
type Presence struct {
|
|
XMLName xml.Name `xml:"presence"`
|
|
PacketAttrs
|
|
Show string `xml:"show,attr,omitempty"` // away, chat, dnd, xa
|
|
Status string `xml:"status,attr,omitempty"`
|
|
Priority string `xml:"priority,attr,omitempty"`
|
|
//Error *clientError
|
|
}
|
|
|
|
func (Presence) Name() string {
|
|
return "presence"
|
|
}
|
|
|
|
type presenceDecoder struct{}
|
|
|
|
var presence presenceDecoder
|
|
|
|
func (presenceDecoder) decode(p *xml.Decoder, se xml.StartElement) (Presence, error) {
|
|
var packet Presence
|
|
err := p.DecodeElement(&packet, &se)
|
|
return packet, err
|
|
}
|