From 45cb2e6f343a559c9abe29201772097fa7b34674 Mon Sep 17 00:00:00 2001 From: Mickael Remond Date: Mon, 10 Jun 2019 11:56:07 +0200 Subject: [PATCH] Add support for Software Version parsing --- iq.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/iq.go b/iq.go index daac0d2..92a9a19 100644 --- a/iq.go +++ b/iq.go @@ -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"` +}