markstory/hubot-xmpp — pull request #23 by dpilone (2012-12-16 22:38:26+00:00)
Title: Add XMPP ping support to hubot-xmpp to fix issues with servers requiring ping responses

Some jabberd servers (most notably OS X's Messages jabber server) send ping requests to XMPP clients with a presence in chat room. If the client application doesn't reply to those ping requests the server will eventually (after about 6 ping requests from what I've seen) boot the client from the chat room. Note that the server will let the client stay logged in, so direct IMs work, but the user is thrown out of the chatroom. This happens with hubot using hubot-xmpp against an OS X Mountain Lion Messages server pretty quickly.

This patch adds support for receiving iq ping requests and responding with a result (pong) response. I also added the corresponding tests.