|
|
@ -41,11 +41,15 @@ var BasicClient = function(params, callback) {
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
jabber.emit('iq', stanza);
|
|
|
|
jabber.emit('iq', stanza);
|
|
|
|
var q = stanza.getChild('query');
|
|
|
|
var q = stanza.getChild('query');
|
|
|
|
|
|
|
|
if(q == undefined) {
|
|
|
|
|
|
|
|
jabber.emit('iq:unknow', stanza);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
if(q.attrs.xmlns != null && jabber._iqHandler[q.attrs.xmlns] != null) {
|
|
|
|
if(q.attrs.xmlns != null && jabber._iqHandler[q.attrs.xmlns] != null) {
|
|
|
|
jabber._iqHandler[q.attrs.xmlns].call(jabber, stanza);
|
|
|
|
jabber._iqHandler[q.attrs.xmlns].call(jabber, stanza);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
jabber.emit('iq:unknow', stanza);
|
|
|
|
jabber.emit('iq:unknow', stanza);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -81,7 +85,7 @@ BasicClient.prototype.presence = function(type) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
BasicClient.prototype.iq = function(to, query, callback, error) {
|
|
|
|
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++;
|
|
|
|
var n = 'node' + this._iq++;
|
|
|
|
this._iqCallback[n] = [callback, error];
|
|
|
|
this._iqCallback[n] = [callback, error];
|
|
|
|
var attrs = {
|
|
|
|
var attrs = {
|
|
|
|