summaryrefslogtreecommitdiffstats
path: root/module/plugins/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'module/plugins/hooks')
-rw-r--r--module/plugins/hooks/AndroidPhoneNotify.py9
-rw-r--r--module/plugins/hooks/WindowsPhoneNotify.py (renamed from module/plugins/hooks/WindowsPhoneToastNotify.py)13
2 files changed, 12 insertions, 10 deletions
diff --git a/module/plugins/hooks/AndroidPhoneNotify.py b/module/plugins/hooks/AndroidPhoneNotify.py
index fbc2acd5c..a3b24a255 100644
--- a/module/plugins/hooks/AndroidPhoneNotify.py
+++ b/module/plugins/hooks/AndroidPhoneNotify.py
@@ -9,7 +9,7 @@ from module.plugins.Hook import Hook
class AndroidPhoneNotify(Hook):
__name__ = "AndroidPhoneNotify"
__type__ = "hook"
- __version__ = "0.03"
+ __version__ = "0.05"
__config__ = [("apikey" , "str" , "API key" , "" ),
("notifycaptcha" , "bool", "Notify captcha request" , True ),
@@ -33,14 +33,15 @@ class AndroidPhoneNotify(Hook):
def setup(self):
- self.info = {} #@TODO: Remove in 0.4.10
+ self.info = {} #@TODO: Remove in 0.4.10
+ self.last_notify = 0
def newCaptchaTask(self, task):
if not self.getConfig("notifycaptcha"):
return False
- if time() - float(self.getStorage("AndroidPhoneNotify", 0)) < self.getConf("timeout"):
+ if time() - self.last_notify < self.getConf("timeout"):
return False
self.notify(_("Captcha"), _("New request waiting user input"))
@@ -76,4 +77,4 @@ class AndroidPhoneNotify(Hook):
'event' : event,
'description': msg})
- self.setStorage("AndroidPhoneNotify", time())
+ self.last_notify = time()
diff --git a/module/plugins/hooks/WindowsPhoneToastNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py
index 20686ee36..e0dd75f92 100644
--- a/module/plugins/hooks/WindowsPhoneToastNotify.py
+++ b/module/plugins/hooks/WindowsPhoneNotify.py
@@ -7,10 +7,10 @@ from time import time
from module.plugins.Hook import Hook
-class WindowsPhoneToastNotify(Hook):
- __name__ = "WindowsPhoneToastNotify"
+class WindowsPhoneNotify(Hook):
+ __name__ = "WindowsPhoneNotify"
__type__ = "hook"
- __version__ = "0.05"
+ __version__ = "0.07"
__config__ = [("id" , "str" , "Push ID" , "" ),
("url" , "str" , "Push url" , "" ),
@@ -35,14 +35,15 @@ class WindowsPhoneToastNotify(Hook):
def setup(self):
- self.info = {} #@TODO: Remove in 0.4.10
+ self.info = {} #@TODO: Remove in 0.4.10
+ self.last_notify = 0
def newCaptchaTask(self, task):
if not self.getConfig("notifycaptcha"):
return False
- if time() - float(self.getStorage("WindowsPhoneToastNotify", 0)) < self.getConf("timeout"):
+ if time() - self.last_notify < self.getConf("timeout"):
return False
self.notify(_("Captcha"), _("New request waiting user input"))
@@ -92,4 +93,4 @@ class WindowsPhoneToastNotify(Hook):
webservice.send(request)
webservice.close()
- self.setStorage("WindowsPhoneToastNotify", time())
+ self.last_notify = time()