- 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

@@ -69,12 +69,18 @@ type Bind struct {
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-bind bind"`
Resource string `xml:"resource,omitempty"`
Jid string `xml:"jid,omitempty"`
// Result sets
ResultSet *ResultSet `xml:"set,omitempty"`
}
func (b *Bind) Namespace() string {
return b.XMLName.Space
}
func (b *Bind) GetSet() *ResultSet {
return b.ResultSet
}
// ============================================================================
// Session (Obsolete)
@@ -89,12 +95,18 @@ func (b *Bind) Namespace() string {
type StreamSession struct {
XMLName xml.Name `xml:"urn:ietf:params:xml:ns:xmpp-session session"`
Optional bool // If element does exist, it mean we are not required to open session
// Result sets
ResultSet *ResultSet `xml:"set,omitempty"`
}
func (s *StreamSession) Namespace() string {
return s.XMLName.Space
}
func (s *StreamSession) GetSet() *ResultSet {
return s.ResultSet
}
func (s *StreamSession) IsOptional() bool {
if s.XMLName.Local == "session" {
return s.Optional