summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mattn
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-03-25 20:45:10 +0100
committerWim <wim@42.be>2017-03-25 20:45:10 +0100
commit07fd825349e8b7e86f8afb3843cb8e2c2afc7c74 (patch)
treeea4b33872a5b925fa0ecd2b421f8f073ba22b2cc /vendor/github.com/mattn
parentbe15cc8a36ed3c207251f9b92815781f2fa8618d (diff)
downloadmatterbridge-msglm-07fd825349e8b7e86f8afb3843cb8e2c2afc7c74.tar.gz
matterbridge-msglm-07fd825349e8b7e86f8afb3843cb8e2c2afc7c74.tar.bz2
matterbridge-msglm-07fd825349e8b7e86f8afb3843cb8e2c2afc7c74.zip
Update vendor
Diffstat (limited to 'vendor/github.com/mattn')
-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'>"+