From e26ff1e9cf87f80451eb869eb781128414c69c2d Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Sun, 9 Jul 2023 16:20:42 +0200 Subject: [PATCH] Add antimixedutf8::action warn handling, and fix generic handling in git version. --- src/modules/antimixedutf8.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/modules/antimixedutf8.c b/src/modules/antimixedutf8.c index 556a624a0..929facc57 100644 --- a/src/modules/antimixedutf8.c +++ b/src/modules/antimixedutf8.c @@ -692,19 +692,25 @@ CMD_OVERRIDE_FUNC(override_msg) logbuf[0] = '\0'; lookalikespam_score(text, logbuf, sizeof(logbuf)); unreal_log(ULOG_INFO, "antimixedutf8", "ANTIMIXEDUTF8_HIT", client, - "[antimixedutf8] Client $client.details hit score $score -- taking action. Mixed scripts detected: $scripts", + "[antimixedutf8] Client $client.details hit score $score. Mixed scripts detected: $scripts", log_data_integer("score", score), log_data_string("scripts", logbuf)); /* Take the action */ retval = take_action(client, cfg.ban_action, cfg.ban_reason, cfg.ban_time, 0); - if (retval == 1) - return; - if (retval == BAN_ACT_BLOCK) + if ((retval == BAN_ACT_WARN) || (retval == BAN_ACT_SOFT_WARN)) + { + /* no action */ + } else + if ((retval == BAN_ACT_BLOCK) || (retval == BAN_ACT_SOFT_BLOCK)) { sendnotice(client, "%s", cfg.ban_reason); return; + } else if (retval > 0) + { + return; } + /* fallthrough for retval <=0 */ } CALL_NEXT_COMMAND_OVERRIDE();