O'Reilly logo

Practical XMPP by David Koelle, Lloyd Watkin

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Handing DISCO#info requests

The one last bit that we want to complete is the handleIq() function that we alluded to in the handleMessage() function. This function will respond with a message giving the capabilities offered by this server-side component specifically, its ability to play XMPPong, which is indicated in part by the identity of the reply as well as the feature that contains the XMPPong namespace:

const handleIq = (stanza) => {     const query = stanza.getChild('query', 'http://jabber.org/protocol/disco#info')     if (!query) return     const reply = new Stanza(       'iq',       {         type: 'result',     id: stanza.attrs.id,     from: stanza.attrs.to,     to: stanza.attrs.from       }     )      .c('query', { xmlns: 'http://jabber.org/protocol/disco#info' ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required