*/
parse: function (item) {
if (item.event !== undefined) {
- $(kiwi.gateway).trigger("on" + item.event, item);
+ $(kiwi.gateway).trigger('on' + item.event, item);
switch (item.event) {
case 'options':
exports.onload = function(){
filters = [];
- compiled_regex = new RegExp(filters.join('|'), 'im');
+
+ if (filter.length > 0) {
+ compiled_regex = new RegExp(filters.join('|'), 'im');
+ }
}
exports.onmsg = function(msg){
- if (msg.msg.search(compiled_regex) > -1) {
+ if (typeof compiled_regex !== 'undefined' && msg.msg.search(compiled_regex) > -1) {
return null;
}