From: Egor Date: Sat, 17 Aug 2024 21:27:05 +0000 (+0300) Subject: spam.lua: lowercase the string before checking X-Git-Url: https://git.patchysicp.xyz/?a=commitdiff_plain;h=18af3ff237b7cbcbfc121e96a6fa010eac9f34f5;p=patchyircd.git spam.lua: lowercase the string before checking --- diff --git a/lua/spam.lua b/lua/spam.lua index 9bb0784..bac32e9 100644 --- a/lua/spam.lua +++ b/lua/spam.lua @@ -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)