Fix luacheck
Fix luacheck warnings in spam.lua Fix global variable initialization (was needed only locally) Add beerchat to luacheck
This commit is contained in:
parent
103c4ae441
commit
c5fd218415
@ -5,7 +5,8 @@ globals = {
|
|||||||
read_globals = {
|
read_globals = {
|
||||||
-- Stdlib
|
-- Stdlib
|
||||||
string = {fields = {"split"}},
|
string = {fields = {"split"}},
|
||||||
table = {fields = {"copy", "getn"}},
|
table = {fields = {"copy", "getn", "indexof"}},
|
||||||
|
beerchat = {fields = {"has_player_muted_player", "execute_callbacks"}},
|
||||||
|
|
||||||
-- Minetest
|
-- Minetest
|
||||||
"minetest",
|
"minetest",
|
||||||
|
@ -28,7 +28,7 @@ local function words_ratio(str, ratio)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function mail.check_spam(message)
|
function mail.check_spam(message)
|
||||||
spam_checks = {}
|
local spam_checks = {}
|
||||||
if caps_ratio(message.subject) == 1 or caps_ratio(message.body) > 0.4 then
|
if caps_ratio(message.subject) == 1 or caps_ratio(message.body) > 0.4 then
|
||||||
table.insert(spam_checks, "caps")
|
table.insert(spam_checks, "caps")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user