summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattn/go-xmpp/xmpp_ping.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-07-13 21:04:28 +0200
committerWim <wim@42.be>2016-08-14 22:40:25 +0200
commit46faad8b57c7c02e2ec158fe7462f751ba63c3be (patch)
tree277ab2e74b4b95cef8b93550994c627a110dfcf1 /vendor/github.com/mattn/go-xmpp/xmpp_ping.go
parent30f30364d587994d40fc1b8eaae4d2404a4329ad (diff)
downloadmatterbridge-msglm-46faad8b57c7c02e2ec158fe7462f751ba63c3be.tar.gz
matterbridge-msglm-46faad8b57c7c02e2ec158fe7462f751ba63c3be.tar.bz2
matterbridge-msglm-46faad8b57c7c02e2ec158fe7462f751ba63c3be.zip
Vendor go-xmpp
Diffstat (limited to 'vendor/github.com/mattn/go-xmpp/xmpp_ping.go')
-rw-r--r--vendor/github.com/mattn/go-xmpp/xmpp_ping.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/vendor/github.com/mattn/go-xmpp/xmpp_ping.go b/vendor/github.com/mattn/go-xmpp/xmpp_ping.go
new file mode 100644
index 00000000..26d056e9
--- /dev/null
+++ b/vendor/github.com/mattn/go-xmpp/xmpp_ping.go
@@ -0,0 +1,27 @@
+package xmpp
+
+import (
+ "fmt"
+)
+
+func (c *Client) PingC2S(jid, server string) error {
+ if jid == "" {
+ jid = c.jid
+ }
+ if server == "" {
+ server = c.domain
+ }
+ _, err := fmt.Fprintf(c.conn, "<iq from='%s' to='%s' id='c2s1' type='get'>\n"+
+ "<ping xmlns='urn:xmpp:ping'/>\n"+
+ "</iq>",
+ xmlEscape(jid), xmlEscape(server))
+ return err
+}
+
+func (c *Client) PingS2S(fromServer, toServer string) error {
+ _, err := fmt.Fprintf(c.conn, "<iq from='%s' to='%s' id='s2s1' type='get'>\n"+
+ "<ping xmlns='urn:xmpp:ping'/>\n"+
+ "</iq>",
+ xmlEscape(fromServer), xmlEscape(toServer))
+ return err
+}