forked from jshiffer/go-xmpp
Merge pull request #59 from chteufleur/PresenceStatus
Add Status into Presence struct
This commit is contained in:
commit
d86062634d
15
xmpp.go
15
xmpp.go
@ -554,10 +554,11 @@ 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 +590,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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -721,8 +722,8 @@ type clientPresence struct {
|
|||||||
Type string `xml:"type,attr"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed
|
Type string `xml:"type,attr"` // error, probe, subscribe, subscribed, unavailable, unsubscribe, unsubscribed
|
||||||
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…
x
Reference in New Issue
Block a user