From c0a68b4a5f6d9820252bf9b04a74672bad04ab58 Mon Sep 17 00:00:00 2001 From: Matthieu Lalonde Date: Fri, 6 Aug 2010 00:17:32 +0200 Subject: [PATCH] nice color --- lib/xmpp-client/client.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/xmpp-client/client.js b/lib/xmpp-client/client.js index b3b9e00..f617bd4 100644 --- a/lib/xmpp-client/client.js +++ b/lib/xmpp-client/client.js @@ -28,7 +28,7 @@ var Client = function(params) { process.exit(1); }); this.xmpp.addListener('stanza', function(stanza) { - sys.debug('STANZA: '[jabber.color] + stanza); + sys.debug('STANZA: '[jabber.color] + ('<' + stanza.name + '> ').bold[jabber.color] + stanza); if(stanza.name == 'iq') { if(stanza.attrs.type == 'result') { jabber._debug('IQ result: ' + stanza); @@ -72,6 +72,12 @@ var Client = function(params) { this.addListener('presence', function(from, stanza) { jabber.presences[from] = stanza.attrs.type; }); + this.addListener('iq', function(stanza) { + var query = stanza.getChild('query', 'http://jabber.org/protocol/disco#info'); + if(query != null) { + sys.debug((stanza.attrs.from + " wont to disco!")[jabber.color]); + } + }); }; sys.inherits(Client, events.EventEmitter);