Add support for Software Version parsing

This commit is contained in:
Mickael Remond 2019-06-10 11:56:07 +02:00
parent 411619c2ef
commit 45cb2e6f34
No known key found for this signature in database
GPG Key ID: E6F6045D79965AA3

16
iq.go
View File

@ -281,6 +281,7 @@ const (
NSDiscoItems = "http://jabber.org/protocol/disco#items"
)
// Disco Info
type DiscoInfo struct {
IQPayload
XMLName xml.Name `xml:"http://jabber.org/protocol/disco#info query"`
@ -301,8 +302,7 @@ type Feature struct {
Var string `xml:"var,attr"`
}
// ============================================================================
// Disco Items
type DiscoItems struct {
IQPayload
XMLName xml.Name `xml:"http://jabber.org/protocol/disco#items query"`
@ -323,3 +323,15 @@ func init() {
TypeRegistry.MapExtension(PKTIQ, xml.Name{"urn:ietf:params:xml:ns:xmpp-bind", "bind"}, BindBind{})
TypeRegistry.MapExtension(PKTIQ, xml.Name{"urn:xmpp:iot:control", "set"}, ControlSet{})
}
// ============================================================================
// Software Version (XEP-0092)
// Version
type Version struct {
IQPayload
XMLName xml.Name `xml:"jabber:iq:version query"`
Name string `xml:"name,omitempty"`
Version string `xml:"version,omitempty"`
OS string `xml:"os,omitempty"`
}