- Changed IQ stanzas to pointer semantics

- Fixed commands from v 0.4.0 and tests
- Added primitive Result Sets support (XEP-0059)
This commit is contained in:
rcorniere
2020-01-31 11:48:03 +01:00
parent 84665d8c13
commit 8798ff6fc1
54 changed files with 724 additions and 229 deletions

View File

@@ -35,12 +35,17 @@ const (
// Roster struct represents Roster IQs
type Roster struct {
XMLName xml.Name `xml:"jabber:iq:roster query"`
// Result sets
ResultSet *ResultSet `xml:"set,omitempty"`
}
// Namespace defines the namespace for the RosterIQ
func (r *Roster) Namespace() string {
return r.XMLName.Space
}
func (r *Roster) GetSet() *ResultSet {
return r.ResultSet
}
// ---------------
// Builder helpers
@@ -64,6 +69,8 @@ func (iq *IQ) RosterIQ() *Roster {
type RosterItems struct {
XMLName xml.Name `xml:"jabber:iq:roster query"`
Items []RosterItem `xml:"item"`
// Result sets
ResultSet *ResultSet `xml:"set,omitempty"`
}
// Namespace lets RosterItems implement the IQPayload interface
@@ -71,6 +78,10 @@ func (r *RosterItems) Namespace() string {
return r.XMLName.Space
}
func (r *RosterItems) GetSet() *ResultSet {
return r.ResultSet
}
// RosterItem represents an item in the roster iq
type RosterItem struct {
XMLName xml.Name `xml:"jabber:iq:roster item"`