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); converse.off(evt, handler);
}, },
'stanza': function (name, options, handler) { 'stanza': function (name, options, handler) {
if (typeof options === 'function') {
handler = options;
options = {};
} else {
options = options || {}; options = options || {};
}
converse.connection.addHandler( converse.connection.addHandler(
handler, handler,
options.ns, options.ns,