From 40fb93962c4dafede2e547eb7591dcc3e7fe036e Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Mon, 2 May 2022 00:12:57 +0200 Subject: [PATCH] [core] Fix: Notify event handlers before rules to prevent delays Signed-off-by: Knut Ahlers --- actions.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/actions.go b/actions.go index 690d8e4..2a9d9e7 100644 --- a/actions.go +++ b/actions.go @@ -66,6 +66,11 @@ func triggerAction(c *irc.Client, m *irc.Message, rule *plugins.Rule, ra *plugin } func handleMessage(c *irc.Client, m *irc.Message, event *string, eventData *plugins.FieldCollection) { + // Send events to registered handlers + if event != nil { + go notifyEventHandlers(*event, eventData) + } + for _, r := range config.GetMatchingRules(m, event, eventData) { var preventCooldown bool @@ -83,9 +88,4 @@ func handleMessage(c *irc.Client, m *irc.Message, event *string, eventData *plug r.SetCooldown(timerStore, m, eventData) } } - - // Send events to registered handlers - if event != nil { - notifyEventHandlers(*event, eventData) - } }