# HG changeset patch # User Thierry Florac # Date 1510316993 -3600 # Node ID 167cc4ab33134ee437dc2164ece9162e4aab4c2d # Parent c4fef7638a606e0126dae832144c3d8469e75486 Don't send notification to event transmitter diff -r c4fef7638a60 -r 167cc4ab3313 src/pyams_notify_ws/notify.py --- a/src/pyams_notify_ws/notify.py Fri Oct 13 10:20:29 2017 +0200 +++ b/src/pyams_notify_ws/notify.py Fri Nov 10 13:29:53 2017 +0100 @@ -61,11 +61,15 @@ action = message.get('action') if action == 'notify': # dispatch notification to subscribers + source = message.get('source', {}).get('id') target = message.get('target', {}).get('principals', ()) clean_message = message.copy() clean_message.pop('target') json_message = json.dumps(clean_message) for connection, subscription in users.items(): + # don't send notification to emitter + if source and (source == subscription.principal['id']): + continue if subscription.filter_target(target): yield from connection.send(json_message) # store message in memcached_queue