|
|
|
@ -41,10 +41,14 @@ var BasicClient = function(params, callback) {
|
|
|
|
|
default:
|
|
|
|
|
jabber.emit('iq', stanza);
|
|
|
|
|
var q = stanza.getChild('query');
|
|
|
|
|
if(q.attrs.xmlns != null && jabber._iqHandler[q.attrs.xmlns] != null) {
|
|
|
|
|
jabber._iqHandler[q.attrs.xmlns].call(jabber, stanza);
|
|
|
|
|
} else {
|
|
|
|
|
if(q == undefined) {
|
|
|
|
|
jabber.emit('iq:unknow', stanza);
|
|
|
|
|
} else {
|
|
|
|
|
if(q.attrs.xmlns != null && jabber._iqHandler[q.attrs.xmlns] != null) {
|
|
|
|
|
jabber._iqHandler[q.attrs.xmlns].call(jabber, stanza);
|
|
|
|
|
} else {
|
|
|
|
|
jabber.emit('iq:unknow', stanza);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -81,7 +85,7 @@ BasicClient.prototype.presence = function(type) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
BasicClient.prototype.iq = function(to, query, callback, error) {
|
|
|
|
|
error |= function(stanza) { sys.error(stanza);};
|
|
|
|
|
error |= function(stanza) { sys.error((this.jid + " : " + stanza.toString()).red);};
|
|
|
|
|
var n = 'node' + this._iq++;
|
|
|
|
|
this._iqCallback[n] = [callback, error];
|
|
|
|
|
var attrs = {
|
|
|
|
|