]> PatchyGit - patchyircd.git/commitdiff
spam.lua: also match against non-stripped text
authorEgor <egor@patchysicp.xyz>
Thu, 2 Jan 2025 21:14:01 +0000 (23:14 +0200)
committerEgor <egor@patchysicp.xyz>
Thu, 2 Jan 2025 21:15:36 +0000 (23:15 +0200)
lua/spam.lua

index 2cfc993..10ca75f 100644 (file)
@@ -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