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() {