summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattn/go-xmpp/xmpp.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/mattn/go-xmpp/xmpp.go')
-rw-r--r--vendor/github.com/mattn/go-xmpp/xmpp.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/vendor/github.com/mattn/go-xmpp/xmpp.go b/vendor/github.com/mattn/go-xmpp/xmpp.go
index 11424f82..84c4ad41 100644
--- a/vendor/github.com/mattn/go-xmpp/xmpp.go
+++ b/vendor/github.com/mattn/go-xmpp/xmpp.go
@@ -606,7 +606,8 @@ func (c *Client) Recv() (stanza interface{}, err error) {
case *clientPresence:
return Presence{v.From, v.To, v.Type, v.Show, v.Status}, nil
case *clientIQ:
- if bytes.Equal(v.Query, []byte(`<ping xmlns='urn:xmpp:ping'/>`)) {
+ // TODO check more strictly
+ if bytes.Equal(v.Query, []byte(`<ping xmlns='urn:xmpp:ping'/>`)) || bytes.Equal(v.Query, []byte(`<ping xmlns="urn:xmpp:ping"/>`)) {
err := c.SendResultPing(v.ID, v.From)
if err != nil {
return Chat{}, err
@@ -632,6 +633,11 @@ func (c *Client) SendPresence(presence Presence) (n int, err error) {
return fmt.Fprintf(c.conn, "<presence from='%s' to='%s'/>", xmlEscape(presence.From), xmlEscape(presence.To))
}
+// SendKeepAlive sends a "whitespace keepalive" as described in chapter 4.6.1 of RFC6120.
+func (c *Client) SendKeepAlive() (n int, err error) {
+ return fmt.Fprintf(c.conn," ")
+}
+
// SendHtml sends the message as HTML as defined by XEP-0071
func (c *Client) SendHtml(chat Chat) (n int, err error) {
return fmt.Fprintf(c.conn, "<message to='%s' type='%s' xml:lang='en'>"+