From 28f0e82c91199723107eaf6f7ebb75555df6fcd3 Mon Sep 17 00:00:00 2001 From: Egor Date: Thu, 2 Jan 2025 23:14:01 +0200 Subject: [PATCH] spam.lua: also match against non-stripped text --- lua/spam.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/spam.lua b/lua/spam.lua index 2cfc993..10ca75f 100644 --- a/lua/spam.lua +++ b/lua/spam.lua @@ -12,9 +12,9 @@ hook_add("sendtochannel", "spam_simple_filter", function(hook, cl1, cl2, chan, t if cl1.umode & 10 ~= 0 or chan.v[cl1.key] or chan.o[cl1.key] then return 0 end - txt = ascii(txt) + atxt = ascii(txt) for k, _ in pairs(simple_filters) do - if txt:find(k, 1, true) then + if txt:find(k, 1, true) or atxt:find(k, 1, true) then return -1 end end @@ -24,9 +24,9 @@ hook_add("sendtoclient", "spam_simple_pm_filter", function(hook, cl1, cl2, chan, if cl1.umode & 10 ~= 0 then return 0 end - txt = ascii(txt) + atxt = ascii(txt) for k, _ in pairs(simple_filters) do - if txt:find(k, 1, true) then + if txt:find(k, 1, true) or atxt:find(k, 1, true) then return -1 end end -- 2.56.0