Priv-check before unmuting

This commit is contained in:
Anand S 2018-04-26 08:07:00 +05:30 committed by Auke Kok
parent 99100857af
commit a820ae6503

View File

@ -83,10 +83,14 @@ function filter.mute(name, duration)
muted[name] = true
minetest.after(duration * 60, function()
privs = minetest.get_player_privs(name)
if privs.shout == true then
return
end
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)
end)