diff --git a/platypush/backend/http/app/routes/hook.py b/platypush/backend/http/app/routes/hook.py index 8d49530cb..6996fcad7 100644 --- a/platypush/backend/http/app/routes/hook.py +++ b/platypush/backend/http/app/routes/hook.py @@ -20,11 +20,13 @@ __routes__ = [ def matches_condition(event: WebhookEvent, hook): if isinstance(hook, dict): - condition = hook.get('condition', {}) + if_ = hook['if'].copy() + if_['type'] = '.'.join([event.__module__, event.__class__.__qualname__]) + + condition = EventCondition.build(if_) else: condition = hook.condition - condition = EventCondition.build(condition) return event.matches_condition(condition)