markstory/hubot-xmpp — pull request #65 by farski (2014-03-16 16:03:29+00:00)
Title: Support for XMPP rosters on connect

I'm trying to eliminate the need for a running a fork of hubot-xmpp just to enable (#41) roster support. The change is pretty minor. The goal here is still to allow for a script like PRX/party-line-hubot@b83852679da18778a5b6d6fcbd6deaee59272fdb to work as a relay/broadcast system over XMPP.

The extra conditional in `readIq` I think it pretty straight forward. I have my doubts about how I exposed `@robot.xmppRoster` and `@robot.xmppClient`. The client may have already been accessible from the robot and I just wasn't sure how, and it may make more sense for the roster to be a property of the client, not the robot. Looking for feedback on either of those points.

If there's a way to accomplish this by extending hubot-xmpp in another library, rather than making this change here directly, I can go that route as well. I just wasn't sure how to intercept the `readIq` block in a good way to do that.

I will add some tests before this gets merged.