mirror of
https://github.com/minetest-mods/filter.git
synced 2025-04-30 05:41:45 -04:00
Merge 66c61c8e6c
into 99100857af
This commit is contained in:
commit
26733c5d73
1 changed files with 6 additions and 11 deletions
17
init.lua
17
init.lua
|
@ -1,9 +1,6 @@
|
|||
|
||||
--[[
|
||||
|
||||
Copyright 2017-8 Auke Kok <sofar@foo-projects.org>
|
||||
Copyright 2018 rubenwardy <rw@rubenwardy.com>
|
||||
|
||||
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 = {} }
|
||||
|
@ -84,11 +78,12 @@ function filter.mute(name, duration)
|
|||
|
||||
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)
|
||||
privs.shout = true
|
||||
minetest.set_player_privs(name, privs)
|
||||
local privs = minetest.get_player_privs(name)
|
||||
if privs.shout == false then
|
||||
minetest.chat_send_player(name, "Chat privilege reinstated. Please do not abuse chat.")
|
||||
privs.shout = true
|
||||
minetest.set_player_privs(name, privs)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue