From 15ff5792f74ffe8b0cdcf24fb91e4ae0c32e94c8 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 7 Feb 2011 19:49:38 +0100 Subject: captchamanager fix --- module/CaptchaManager.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'module/CaptchaManager.py') diff --git a/module/CaptchaManager.py b/module/CaptchaManager.py index 7c851a16e..1520bb1b9 100644 --- a/module/CaptchaManager.py +++ b/module/CaptchaManager.py @@ -59,10 +59,11 @@ class CaptchaManager(): return None def handleCaptcha(self, task): - if self.core.isClientConnected: #client connected -> should solve the captcha + cli = self.core.isClientConnected() + + if cli: #client connected -> should solve the captcha self.tasks.append(task) task.setWaiting(40) #wait 40 sec for response - return True for plugin in self.core.hookManager.activePlugins(): try: @@ -71,8 +72,8 @@ class CaptchaManager(): if self.core.debug: print_exc() - if task.handler: # a plugin handles the captcha - return True + if task.handler or cli: #the captcha was handled + return True task.error = _("No Client connected for captcha decrypting") @@ -85,7 +86,7 @@ class CaptchaTask(): self.captchaImg = img self.captchaType = type self.captchaFile = temp - self.handler = None #the hook plugin that will take care of the solution + self.handler = [] #the hook plugins that will take care of the solution self.result = None self.waitUntil = None self.error = None #error message @@ -132,12 +133,10 @@ class CaptchaTask(): def invalid(self): """ indicates the captcha was not correct """ - if self.handler: - self.handler.captchaInvalid() + [x.captchaInvalid() for x in self.handler] def correct(self): - if self.handler: - self.handler.captchaCorrect() + [x.captchaCorrect() for x in self.handler] def __str__(self): return "" % self.id -- cgit v1.2.3