Skip to content

Commit

Permalink
updated to support status token
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Aug 20, 2023
1 parent d974eab commit 3601845
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions apprise/plugins/NotifyPushMe.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,8 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
# Prepare our payload
params = {
'push_key': self.token,
'title': title if not self.status else '{} {}'.format(
self.asset.ascii(notify_type), title),
'title': title if not self.status
else '{} {}'.format(self.asset.ascii(notify_type), title),
'content': body,
'type': 'markdown'
if self.notify_format == NotifyFormat.MARKDOWN else 'text'
Expand Down Expand Up @@ -207,10 +207,6 @@ def parse_url(url):
# We're done early as we couldn't load the results
return results

# Get status switch
results['status'] = \
parse_bool(results['qsd'].get('status', True))

# Store our token using the host
results['token'] = NotifyPushMe.unquote(results['host'])

Expand All @@ -222,4 +218,8 @@ def parse_url(url):
# Support 'push_key' if specified
results['token'] = NotifyPushMe.unquote(results['qsd']['push_key'])

# Get status switch
results['status'] = \
parse_bool(results['qsd'].get('status', True))

return results
4 changes: 2 additions & 2 deletions test/test_plugin_pushme.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
'privacy_url': 'pushme://a...a/',
}),
# Token specified
('pushme://?token=%s' % ('b' * 6), {
('pushme://?token=%s&status=yes' % ('b' * 6), {
'instance': NotifyPushMe,

# Our expected url(privacy=True) startswith() response:
Expand All @@ -76,7 +76,7 @@
'privacy_url': 'pushme://b...b/',
}),
# Token specified
('pushme://?push_key=%s' % ('p' * 6), {
('pushme://?push_key=%s&status=no' % ('p' * 6), {
'instance': NotifyPushMe,

# Our expected url(privacy=True) startswith() response:
Expand Down

0 comments on commit 3601845

Please sign in to comment.