forked from jshiffer/go-xmpp
Add Status into Presence struct
This commit is contained in:
parent
84b9ced4e9
commit
6618fc47ca
14
xmpp.go
14
xmpp.go
@ -554,10 +554,12 @@ type Contact struct {
|
|||||||
|
|
||||||
// Presence is an XMPP presence notification.
|
// Presence is an XMPP presence notification.
|
||||||
type Presence struct {
|
type Presence struct {
|
||||||
From string
|
From string
|
||||||
To string
|
To string
|
||||||
Type string
|
Type string
|
||||||
Show string
|
Show string
|
||||||
|
Status string
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recv waits to receive the next XMPP stanza.
|
// Recv waits to receive the next XMPP stanza.
|
||||||
@ -589,7 +591,7 @@ func (c *Client) Recv() (stanza interface{}, err error) {
|
|||||||
}
|
}
|
||||||
return Chat{Type: "roster", Roster: r}, nil
|
return Chat{Type: "roster", Roster: r}, nil
|
||||||
case *clientPresence:
|
case *clientPresence:
|
||||||
return Presence{v.From, v.To, v.Type, v.Show}, nil
|
return Presence{v.From, v.To, v.Type, v.Show, v.Status}, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -722,7 +724,7 @@ type clientPresence struct {
|
|||||||
Lang string `xml:"lang,attr"`
|
Lang string `xml:"lang,attr"`
|
||||||
|
|
||||||
Show string `xml:"show"` // away, chat, dnd, xa
|
Show string `xml:"show"` // away, chat, dnd, xa
|
||||||
Status string `xml:"status,attr"` // sb []clientText
|
Status string `xml:"status"` // sb []clientText
|
||||||
Priority string `xml:"priority,attr"`
|
Priority string `xml:"priority,attr"`
|
||||||
Error *clientError
|
Error *clientError
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user