~samwhited/xmpp

c720d72f8269f27e21b716e442d01735d2e31b0c — Sam Whited 3 years ago 40440be
ping: rename PingIQ to IQ
2 files changed, 4 insertions(+), 4 deletions(-)

M ping/example_test.go
M ping/ping.go
M ping/example_test.go => ping/example_test.go +1 -1
@@ 19,7 19,7 @@ func Example() {
	e := xml.NewEncoder(os.Stdout)
	e.Indent("", "\t")

	ping := ping.PingIQ(j)
	ping := ping.IQ(j)
	if _, err := xmlstream.Copy(e, ping); err != nil {
		log.Fatal(err)
	}

M ping/ping.go => ping/ping.go +3 -3
@@ 16,9 16,9 @@ import (
// NS is the XML namespace used by XMPP pings. It is provided as a convenience.
const NS = `urn:xmpp:ping`

// PingIQ returns an xmlstream.TokenReader that outputs a new IQ stanza with a
// ping payload.
func PingIQ(to *jid.JID) xmlstream.TokenReader {
// IQ returns an xmlstream.TokenReader that outputs a new IQ stanza with a ping
// payload.
func IQ(to *jid.JID) xmlstream.TokenReader {
	start := xml.StartElement{Name: xml.Name{Local: "ping", Space: NS}}
	return stanza.WrapIQ(to, stanza.GetIQ, xmlstream.Wrap(nil, start))
}