summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-21 17:44:51 +0200
committerGravatar Walter Purcaro <vuolter@users.noreply.github.com> 2015-10-21 17:44:51 +0200
commit213e3e7b3aa3c7532deb3c1e5ba9632e1c3e01f0 (patch)
tree35ceda0a1c5aa8487f12991d1ff94839d3649ba4 /module
parent[Base] Improve wait method (diff)
downloadpyload-213e3e7b3aa3c7532deb3c1e5ba9632e1c3e01f0.tar.xz
[Notifier] Fix https://github.com/pyload/pyload/issues/2092
Diffstat (limited to 'module')
-rw-r--r--module/plugins/hooks/WindowsPhoneNotify.py4
-rw-r--r--module/plugins/internal/Notifier.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/module/plugins/hooks/WindowsPhoneNotify.py b/module/plugins/hooks/WindowsPhoneNotify.py
index 3a72e0b39..cd5f5dea4 100644
--- a/module/plugins/hooks/WindowsPhoneNotify.py
+++ b/module/plugins/hooks/WindowsPhoneNotify.py
@@ -34,7 +34,7 @@ class WindowsPhoneNotify(Notifier):
return self.get_config('push-id'), self.get_config('push-url')
- def get_xml_data(self, msg):
+ def format_request(self, msg):
return ("<?xml version='1.0' encoding='utf-8'?> <wp:Notification xmlns:wp='WPNotification'> "
"<wp:Toast> <wp:Text1>pyLoad</wp:Text1> <wp:Text2>%s</wp:Text2> "
"</wp:Toast> </wp:Notification>" % msg)
@@ -42,7 +42,7 @@ class WindowsPhoneNotify(Notifier):
def send(self, event, msg, key):
id, url = key
- request = self.get_xml_data("%s: %s" % (event, msg) if msg else event)
+ request = self.format_request("%s: %s" % (event, msg) if msg else event)
webservice = httplib.HTTP(url)
webservice.putrequest("POST", id)
diff --git a/module/plugins/internal/Notifier.py b/module/plugins/internal/Notifier.py
index 055f5a929..b397b8f38 100644
--- a/module/plugins/internal/Notifier.py
+++ b/module/plugins/internal/Notifier.py
@@ -9,7 +9,7 @@ from module.plugins.internal.utils import isiterable
class Notifier(Addon):
__name__ = "Notifier"
__type__ = "hook"
- __version__ = "0.02"
+ __version__ = "0.03"
__status__ = "testing"
__config__ = [("activated" , "bool", "Activated" , False),
@@ -85,7 +85,7 @@ class Notifier(Addon):
@Expose
def notify(self, event, msg="", key=None):
key = key or self.get_key()
- if isiterable(key) and all(key) or not key:
+ if not key or isiterable(key) and not all(key):
return
if self.pyload.isClientConnected() and not self.get_config('ignoreclient'):