mirror of
https://github.com/FluuxIO/go-xmpp.git
synced 2024-11-21 01:52:01 -08:00
Fix marshalling/unmarshalling of command children
This commit is contained in:
parent
5f99e1cd06
commit
9af32ad7e0
@ -56,6 +56,8 @@ type CommandElement interface {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Actions struct {
|
type Actions struct {
|
||||||
|
XMLName xml.Name `xml:"actions"`
|
||||||
|
|
||||||
Prev *struct{} `xml:"prev,omitempty"`
|
Prev *struct{} `xml:"prev,omitempty"`
|
||||||
Next *struct{} `xml:"next,omitempty"`
|
Next *struct{} `xml:"next,omitempty"`
|
||||||
Complete *struct{} `xml:"complete,omitempty"`
|
Complete *struct{} `xml:"complete,omitempty"`
|
||||||
@ -68,6 +70,8 @@ func (a *Actions) Ref() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Note struct {
|
type Note struct {
|
||||||
|
XMLName xml.Name `xml:"note"`
|
||||||
|
|
||||||
Text string `xml:",cdata"`
|
Text string `xml:",cdata"`
|
||||||
Type string `xml:"type,attr,omitempty"`
|
Type string `xml:"type,attr,omitempty"`
|
||||||
}
|
}
|
||||||
@ -117,11 +121,11 @@ func (c *Command) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|||||||
var err error
|
var err error
|
||||||
switch tt.Name.Local {
|
switch tt.Name.Local {
|
||||||
|
|
||||||
case "affiliations":
|
case "actions":
|
||||||
a := Actions{}
|
a := Actions{}
|
||||||
err = d.DecodeElement(&a, &tt)
|
err = d.DecodeElement(&a, &tt)
|
||||||
c.CommandElement = &a
|
c.CommandElement = &a
|
||||||
case "configure":
|
case "note":
|
||||||
nt := Note{}
|
nt := Note{}
|
||||||
err = d.DecodeElement(&nt, &tt)
|
err = d.DecodeElement(&nt, &tt)
|
||||||
c.CommandElement = &nt
|
c.CommandElement = &nt
|
||||||
|
Loading…
Reference in New Issue
Block a user