mirror of
https://github.com/caronc/apprise.git
synced 2025-06-22 10:41:27 +02:00
Bugfix: Avoid duplicate target Dapnet call signs (#521)
This commit is contained in:
parent
aa3d30f7b7
commit
6fbe23832b
@ -201,7 +201,9 @@ class NotifyDapnet(NotifyBase):
|
|||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Store callsign
|
# Store callsign without SSID and
|
||||||
|
# ignore duplicates
|
||||||
|
if result['callsign'] not in self.targets:
|
||||||
self.targets.append(result['callsign'])
|
self.targets.append(result['callsign'])
|
||||||
|
|
||||||
return
|
return
|
||||||
@ -356,7 +358,8 @@ class NotifyDapnet(NotifyBase):
|
|||||||
# Support the 'to' variable so that we can support rooms this way too
|
# Support the 'to' variable so that we can support rooms this way too
|
||||||
# The 'to' makes it easier to use yaml configuration
|
# The 'to' makes it easier to use yaml configuration
|
||||||
if 'to' in results['qsd'] and len(results['qsd']['to']):
|
if 'to' in results['qsd'] and len(results['qsd']['to']):
|
||||||
results['targets'] += parse_call_sign(results['qsd']['to'])
|
results['targets'] += \
|
||||||
|
NotifyDapnet.parse_list(results['qsd']['to'])
|
||||||
|
|
||||||
# Check for priority
|
# Check for priority
|
||||||
if 'priority' in results['qsd'] and len(results['qsd']['priority']):
|
if 'priority' in results['qsd'] and len(results['qsd']['priority']):
|
||||||
|
@ -59,6 +59,15 @@ apprise_url_tests = (
|
|||||||
'instance': plugins.NotifyDapnet,
|
'instance': plugins.NotifyDapnet,
|
||||||
'requests_response_code': requests.codes.created,
|
'requests_response_code': requests.codes.created,
|
||||||
}),
|
}),
|
||||||
|
('dapnet://user:pass@DF1ABC-1/DF1ABC/DF1ABC-15', {
|
||||||
|
# valid call signs; but a few are duplicates;
|
||||||
|
# at the end there will only be 1 entry
|
||||||
|
'instance': plugins.NotifyDapnet,
|
||||||
|
'requests_response_code': requests.codes.created,
|
||||||
|
# Our expected url(privacy=True) startswith() response:
|
||||||
|
# Note that only 1 entry is saved (as other 2 are duplicates)
|
||||||
|
'privacy_url': 'dapnet://user:****@D...C?',
|
||||||
|
}),
|
||||||
('dapnet://user:pass@?to={},{}'.format('DF1ABC', 'DF1DEF'), {
|
('dapnet://user:pass@?to={},{}'.format('DF1ABC', 'DF1DEF'), {
|
||||||
# support the to= argument
|
# support the to= argument
|
||||||
'instance': plugins.NotifyDapnet,
|
'instance': plugins.NotifyDapnet,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user