diff --git a/apprise/plugins/NotifyDapnet.py b/apprise/plugins/NotifyDapnet.py index ee5f0409..2e0389db 100644 --- a/apprise/plugins/NotifyDapnet.py +++ b/apprise/plugins/NotifyDapnet.py @@ -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']): diff --git a/test/test_plugin_dapnet.py b/test/test_plugin_dapnet.py index 9461238b..9f63c8f2 100644 --- a/test/test_plugin_dapnet.py +++ b/test/test_plugin_dapnet.py @@ -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,