]> PatchyGit - patchyircd.git/commitdiff
spam.lua: lowercase the string before checking
authorEgor <egor@patchysicp.xyz>
Sat, 17 Aug 2024 21:27:05 +0000 (00:27 +0300)
committerEgor <egor@patchysicp.xyz>
Sat, 17 Aug 2024 21:27:05 +0000 (00:27 +0300)
lua/spam.lua

index 9bb0784..bac32e9 100644 (file)
@@ -3,7 +3,7 @@ if not spamlevel then
        spamlevel = 0
 end
 local function ascii(txt)
-       txt = txt:gsub("[^ -~]", "")
+       txt = txt:gsub("[^ -~]", ""):lower()
        return txt
 end
 function setspamlevel(newlevel)
@@ -14,7 +14,7 @@ function setspamlevel(newlevel)
                end
                txt = ascii(txt)
                if not chan.v[cl1.key] and not chan.o[cl1.key] and
-                       (txt:find("irc.supernets.org", 1, true) or txt:find("IRC.SUPERNETS.ORG", 1, true)) then
+                       txt:find("irc.supernets.org", 1, true) then
                        return -1
                end
        end)
@@ -24,7 +24,7 @@ function setspamlevel(newlevel)
                end
                txt = ascii(txt)
                if not chan.v[cl1.key] and not chan.o[cl1.key] and
-                       (txt:find("hardchats.com", 1, true) or txt:find("HARDCHAT", 1, true)) then
+                       (txt:find("hardchats.com", 1, true) or txt:find("hardchat", 1, true)) then
                        return -1
                end
        end)