From 7126417e379af8b886ebb0d4dcebdbffcad4cd85 Mon Sep 17 00:00:00 2001 From: pixelrebel Date: Tue, 6 Oct 2015 13:02:12 -0700 Subject: [PATCH] Add id to iq ping stanza Increments a new id for each ping. Currently, no id is provided so the response from the server is: `[Tue Oct 06 2015 12:18:47 GMT-0700 (PDT)] ERROR [xmpp error]Missing 'id'` --- src/xmpp.coffee | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xmpp.coffee b/src/xmpp.coffee index 599eb88..567baf8 100644 --- a/src/xmpp.coffee +++ b/src/xmpp.coffee @@ -8,6 +8,7 @@ util = require 'util' class XmppBot extends Adapter reconnectTryCount: 0 + currentIqId: 1001 constructor: ( robot ) -> @robot = robot @@ -108,7 +109,7 @@ class XmppBot extends Adapter @reconnectTryCount = 0 ping: => - ping = new ltx.Element('iq', type: 'get') + ping = new ltx.Element('iq', type: 'get', id: @currentIqId++) ping.c('ping', xmlns: 'urn:xmpp:ping') @robot.logger.debug "[sending ping] #{ping}"