forked from jshiffer/go-xmpp
Priority is an int
This commit is contained in:
parent
923fd61587
commit
5d362b505b
@ -10,7 +10,7 @@ type Presence struct {
|
|||||||
PacketAttrs
|
PacketAttrs
|
||||||
Show string `xml:"show,omitempty"` // away, chat, dnd, xa
|
Show string `xml:"show,omitempty"` // away, chat, dnd, xa
|
||||||
Status string `xml:"status,omitempty"`
|
Status string `xml:"status,omitempty"`
|
||||||
Priority string `xml:"priority,omitempty"`
|
Priority int `xml:"priority,omitempty"`
|
||||||
Error Err `xml:"error,omitempty"`
|
Error Err `xml:"error,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,13 +34,13 @@ func TestPresenceSubElt(t *testing.T) {
|
|||||||
type pres struct {
|
type pres struct {
|
||||||
Show string `xml:"show"`
|
Show string `xml:"show"`
|
||||||
Status string `xml:"status"`
|
Status string `xml:"status"`
|
||||||
Priority string `xml:"priority"`
|
Priority int `xml:"priority"`
|
||||||
}
|
}
|
||||||
|
|
||||||
presence := xmpp.NewPresence("admin@localhost", "test@localhost", "1", "en")
|
presence := xmpp.NewPresence("admin@localhost", "test@localhost", "1", "en")
|
||||||
presence.Show = "xa"
|
presence.Show = "xa"
|
||||||
presence.Status = "Coding"
|
presence.Status = "Coding"
|
||||||
presence.Priority = "10"
|
presence.Priority = 10
|
||||||
|
|
||||||
data, err := xml.Marshal(presence)
|
data, err := xml.Marshal(presence)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -59,6 +59,6 @@ func TestPresenceSubElt(t *testing.T) {
|
|||||||
t.Errorf("cannot read 'status' as presence subelement (%s)", parsedPresence.Status)
|
t.Errorf("cannot read 'status' as presence subelement (%s)", parsedPresence.Status)
|
||||||
}
|
}
|
||||||
if parsedPresence.Priority != presence.Priority {
|
if parsedPresence.Priority != presence.Priority {
|
||||||
t.Errorf("cannot read 'priority' as presence subelement (%s)", parsedPresence.Priority)
|
t.Errorf("cannot read 'priority' as presence subelement (%d)", parsedPresence.Priority)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user