Skip to content

Commit

Permalink
removeAll was in the wrong spot doing the wrong thing
Browse files Browse the repository at this point in the history
  • Loading branch information
moshmage committed May 26, 2016
1 parent 9e5c138 commit 6429503
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eventer.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ Eventer = module.exports = function Eventer(IrcLib, IrcConf) {
return;
}

if (removeAll) {
self.EVENTSNET[eventType] = [];
return;
}

self.EVENTSNET[eventType].some(function(object, index){
if (object.wordMatch === wordMatch) {
found = index;
Expand All @@ -113,7 +118,7 @@ Eventer = module.exports = function Eventer(IrcLib, IrcConf) {
self.EVENTSNET[eventType].splice(found,1);
}

if (self.FORCEKEEP.indexOf(eventType) < 0 && self.EVENTSNET[eventType].length === 0 || removeAll) {
if (self.FORCEKEEP.indexOf(eventType) < 0 && self.EVENTSNET[eventType].length === 0) {
destroyEventType(eventType);
}

Expand Down

0 comments on commit 6429503

Please sign in to comment.