mirror of
https://github.com/caronc/apprise.git
synced 2025-02-06 05:19:15 +01:00
Bugfix: Avoid duplicate target Dapnet call signs (#521)
This commit is contained in:
parent
aa3d30f7b7
commit
6fbe23832b
@ -201,8 +201,10 @@ class NotifyDapnet(NotifyBase):
|
||||
)
|
||||
continue
|
||||
|
||||
# Store callsign
|
||||
self.targets.append(result['callsign'])
|
||||
# Store callsign without SSID and
|
||||
# ignore duplicates
|
||||
if result['callsign'] not in self.targets:
|
||||
self.targets.append(result['callsign'])
|
||||
|
||||
return
|
||||
|
||||
@ -356,7 +358,8 @@ class NotifyDapnet(NotifyBase):
|
||||
# Support the 'to' variable so that we can support rooms this way too
|
||||
# The 'to' makes it easier to use yaml configuration
|
||||
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
|
||||
if 'priority' in results['qsd'] and len(results['qsd']['priority']):
|
||||
|
@ -59,6 +59,15 @@ apprise_url_tests = (
|
||||
'instance': plugins.NotifyDapnet,
|
||||
'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'), {
|
||||
# support the to= argument
|
||||
'instance': plugins.NotifyDapnet,
|
||||
|
Loading…
Reference in New Issue
Block a user