Disabled notifications still enabled

This commit is contained in:
Ruud
2012-04-07 19:15:08 +02:00
parent 5f319635c2
commit 24a65ea927
3 changed files with 10 additions and 10 deletions
+7 -6
View File
@@ -23,14 +23,15 @@ class Notification(Plugin):
# Attach listeners
for listener in self.listen_to:
if not listener in self.dont_listen_to:
addEvent(listener, self.createNotifyHandler(listener))
# Add on snatch default
def notify(message, data):
if not self.conf('on_snatch', default = 1) and listener == 'movie.snatched':
return
return self.notify(message = message, data = data)
def createNotifyHandler(self, listener):
def notify(message, data):
if not self.conf('on_snatch', default = True) and listener == 'movie.snatched':
return
return self.notify(message = message, data = data)
addEvent(listener, notify)
return notify
def notify(self, message = '', data = {}):
pass
+1 -1
View File
@@ -34,7 +34,7 @@ class Growl(Notification):
except:
log.error('Failed register of growl: %s' % traceback.format_exc())
def notify(self, type = '', message = '', data = {}):
def notify(self, message = '', data = {}):
if self.isDisabled(): return
self.register()
@@ -8,9 +8,7 @@ log = CPLog(__name__)
class NotifyMyWP(Notification):
def notify(self, message = '', data = {}):
if self.isDisabled():
return
if self.isDisabled(): return
keys = self.conf('api_key').split(',')
p = PyNMWP(keys, self.conf('dev_key'))
@@ -20,5 +18,6 @@ class NotifyMyWP(Notification):
for key in keys:
if not response[key]['Code'] == u'200':
log.error('Could not send notification to NotifyMyWindowsPhone (%s). %s' % (key, response[key]['message']))
return False
return response