From fdce7f16510477c2aad2072736d7cc07f7eab3b8 Mon Sep 17 00:00:00 2001 From: Matthieu Lalonde Date: Fri, 6 Aug 2010 00:02:39 +0200 Subject: [PATCH] initial presence --- lib/xmpp-client/client.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/xmpp-client/client.js b/lib/xmpp-client/client.js index ec0a617..b3b9e00 100644 --- a/lib/xmpp-client/client.js +++ b/lib/xmpp-client/client.js @@ -34,7 +34,7 @@ var Client = function(params) { jabber._debug('IQ result: ' + stanza); jabber.emit('iqResult', stanza.attrs.id, stanza); } else { - this._debug('IQ: ' + stanza); + jabber._debug('IQ: ' + stanza); jabber.emit('iq', stanza); } } @@ -110,8 +110,8 @@ Client.prototype.iq = function(iq, callback) { this.xmpp.send(new xmpp.Element('iq', {type:"get", id: n}).cnode(iq).tree()); }; -Client.prototype.presence = function() { - this.xmpp.send(new xmpp.Element('presence', {type: 'available'}).tree()); +Client.prototype.presence = function(type) { + this.xmpp.send(new xmpp.Element('presence', (type != null) ? {type: type} : {}).tree()); }; Client.prototype.disconnect = function() {