- 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

@@ -9,7 +9,10 @@ import (
)
func main() {
iq := stanza.NewIQ(stanza.Attrs{Type: stanza.IQTypeGet, To: "service.localhost", Id: "custom-pl-1"})
iq, err := stanza.NewIQ(stanza.Attrs{Type: stanza.IQTypeGet, To: "service.localhost", Id: "custom-pl-1"})
if err != nil {
log.Fatalf("failed to create IQ: %v", err)
}
payload := CustomPayload{XMLName: xml.Name{Space: "my:custom:payload", Local: "query"}, Node: "test"}
iq.Payload = payload
@@ -45,5 +48,5 @@ func (c CustomPayload) Namespace() string {
}
func init() {
stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{"my:custom:payload", "query"}, CustomPayload{})
stanza.TypeRegistry.MapExtension(stanza.PKTIQ, xml.Name{Space: "my:custom:payload", Local: "query"}, CustomPayload{})
}