27 lines
864 B
Go
27 lines
864 B
Go
package stanza
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"encoding/xml"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Capabilities
|
||
|
|
// Reference: https://xmpp.org/extensions/xep-0115.html#stream
|
||
|
|
// "A server MAY include its entity capabilities in a stream feature element so that connecting clients
|
||
|
|
// and peer servers do not need to send service discovery requests each time they connect."
|
||
|
|
// This is not a stream feature but a way to let client cache server disco info.
|
||
|
|
|
||
|
|
// Moved from stream_features.go and made it a presence extension as per spec
|
||
|
|
|
||
|
|
type Caps struct {
|
||
|
|
PresExtension
|
||
|
|
XMLName xml.Name `xml:"http://jabber.org/protocol/caps c"`
|
||
|
|
Hash string `xml:"hash,attr"`
|
||
|
|
Node string `xml:"node,attr"`
|
||
|
|
Ver string `xml:"ver,attr"`
|
||
|
|
Ext string `xml:"ext,attr,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
TypeRegistry.MapExtension(PKTPresence, xml.Name{Space: "http://jabber.org/protocol/caps", Local: "c"}, Caps{})
|
||
|
|
}
|