Allow stanza listener to be registered without options obj

This commit is contained in:
JC Brand 2016-03-16 18:31:55 +00:00
parent 36a875a402
commit d3767426f6

View File

@ -145,7 +145,12 @@
converse.off(evt, handler);
},
'stanza': function (name, options, handler) {
options = options || {};
if (typeof options === 'function') {
handler = options;
options = {};
} else {
options = options || {};
}
converse.connection.addHandler(
handler,
options.ns,