From 050fa88e479bf395b49f4cdbf99b00c0cbd22285 Mon Sep 17 00:00:00 2001 From: reality Date: Tue, 7 Jul 2015 18:17:10 +0000 Subject: [PATCH] working flag --- modules/atheme/atheme.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/atheme/atheme.js b/modules/atheme/atheme.js index ecd76bf..0a49333 100644 --- a/modules/atheme/atheme.js +++ b/modules/atheme/atheme.js @@ -18,13 +18,14 @@ var atheme = function(dbot) { this.flagStack[server][channel] = { 'flags': {}, 'callbacks': [ callback ], - 'timeout': null + 'timeout': null, + 'working': false }; } dbot.say(server, 'chanserv', 'FLAGS ' + channel); this.flagStack[server][channel].timeout = setTimeout(function() { // Delete callback if no response - if(_.has(this.flagStack[server], channel)) { + if(_.has(this.flagStack[server], channel) && this.flagStack[server][channel].working == false) { _.each(this.flagStack[server][channel].callbacks, function(callback) { callback(true, null); }); @@ -87,6 +88,7 @@ var atheme = function(dbot) { this.flagStack[event.server][flags[4]].flags[flags[2]] = flags[3]; } else if(end) { if(_.has(this.flagStack[event.server], end[1])) { + this.flagStack[event.server][end[1]].working = true; // Parse wildcard hostmasks to nicks var allFlags = this.flagStack[event.server][end[1]].flags, hostMasks = {};