From 53312940c0cd75a6ad70b40a195764eec6b92344 Mon Sep 17 00:00:00 2001 From: Anand S <36130650+ClobberXD@users.noreply.github.com> Date: Fri, 20 Apr 2018 12:17:56 +0530 Subject: [PATCH] Reverted all changes Will make dedicated branch for each commit --- init.lua | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/init.lua b/init.lua index ecb2ac5..a980c1c 100644 --- a/init.lua +++ b/init.lua @@ -1,9 +1,6 @@ - --[[ - Copyright 2017-8 Auke Kok Copyright 2018 rubenwardy - Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including @@ -11,10 +8,8 @@ distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND @@ -22,7 +17,6 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ]]-- filter = { registered_on_violations = {} } @@ -62,9 +56,8 @@ function filter.register_on_violation(func) end function filter.check_message(name, message) - local trimmed_msg = message:gsub(" ","") for _, w in ipairs(words) do - if string.find(trimmed_msg:lower(), "%f[%a]" .. w .. "%f[%A]") then + if string.find(message:lower(), "%f[%a]" .. w .. "%f[%A]") then return false end end @@ -79,18 +72,17 @@ function filter.mute(name, duration) minetest.set_player_privs(name, privs) end - minetest.chat_send_player(name, minetest.colorize("#FF8C00","Watch your language! You have been temporarily muted")) + minetest.chat_send_player(name, "Watch your language! You have been temporarily muted") muted[name] = true minetest.after(duration * 60, function() muted[name] = nil + minetest.chat_send_player(name, "Chat privilege reinstated. Please do not abuse chat.") + local privs = minetest.get_player_privs(name) - if privs.shout == false then - minetest.chat_send_player(name, minetest.colorize("#FF8C00","Chat privilege reinstated. Please do not abuse chat.")) - privs.shout = true - minetest.set_player_privs(name, privs) - end + privs.shout = true + minetest.set_player_privs(name, privs) end) end