From: Egor Date: Thu, 2 Jan 2025 21:14:01 +0000 (+0200) Subject: spam.lua: also match against non-stripped text X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=28f0e82c91199723107eaf6f7ebb75555df6fcd3;p=patchyircd.git spam.lua: also match against non-stripped text --- 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