Allow overriding topic

This commit is contained in:
2023-01-12 07:20:48 +00:00
parent 0b840d227b
commit 4f55ffeaf7
6 changed files with 42 additions and 9 deletions

View File

@@ -26,7 +26,14 @@ def rule_matched(rule, message, matched_fields):
notify_message = f"{rule.name} matched on {matched_fields}\n{message}"
notify_message = notify_message.encode("utf-8", "replace")
sendmsg(rule.user, notify_message, title=title, priority=str(rule.priority))
cast = {
"title": title,
"priority": str(rule.priority),
}
if rule.topic is not None:
cast["topic"] = rule.topic
sendmsg(rule.user, notify_message, **cast)
def process_rules(data):