~samwhited/xmpp

394b92c6dda311a86d7b9646420dabcba896fa50 — Sam Whited a month ago 5d1a18e
stanza: update documentation

Fix the stanza creation example to use the newer Wrap method and add an
ID argument to make it more obvious that you have to add IDs to the
stanzas yourself.

See #17

Signed-off-by: Sam Whited <sam@samwhited.com>
1 files changed, 6 insertions(+), 5 deletions(-)

M stanza/doc.go
M stanza/doc.go => stanza/doc.go +6 -5
@@ 47,11 47,12 @@
//
//    // PingIQ returns an xml.TokenReader that outputs a new IQ stanza with a
//    // ping payload.
//    func PingIQ(to jid.JID) xml.TokenReader {
//    func PingIQ(id string, to jid.JID) xml.TokenReader {
//        start := xml.StartElement{Name: xml.Name{Space: "urn:xmpp:ping", Local: "ping"}}
//        return stanza.WrapIQ(
//            stanza.IQ{To: to, Type: stanza.GetIQ},
//            xmlstream.Wrap(nil, start)
//        )
//        return stanza.IQ{
//            ID: id,
//            To: to,
//            Type: stanza.GetIQ,
//        }.Wrap(start)
//    }
package stanza // import "mellium.im/xmpp/stanza"