Fix compatibility with beerchat muting (#21)

This commit is contained in:
coil 2020-01-02 19:30:53 -05:00 committed by David Leal
parent d7802b7cd2
commit 9f99764820

@ -143,7 +143,7 @@ end)
function tp.tpr_send(sender, receiver) function tp.tpr_send(sender, receiver)
-- Compatibility with beerchat (UNTESTED) -- Compatibility with beerchat (UNTESTED)
if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then
if minetest.get_player_by_name(sender):get_meta():get_string("beerchat:muted:" .. sender) then if minetest.get_player_by_name(receiver):get_meta():get_string("beerchat:muted:" .. sender) == "true" then
minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted."))
if minetest.get_modpath("chat2") then if minetest.get_modpath("chat2") then
chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF) chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF)
@ -227,7 +227,7 @@ end
function tp.tphr_send(sender, receiver) function tp.tphr_send(sender, receiver)
-- Compatibility with beerchat (UNTESTED) -- Compatibility with beerchat (UNTESTED)
if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then if minetest.get_modpath("beerchat") and not minetest.check_player_privs(sender, {tp_admin = true}) then
if minetest.get_player_by_name(sender):get_meta():get_string("beerchat:muted:" .. sender) then if minetest.get_player_by_name(receiver):get_meta():get_string("beerchat:muted:" .. sender) == "true" then
minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted.")) minetest.chat_send_player(sender, S("You are not allowed to send requests because you're muted."))
if minetest.get_modpath("chat2") then if minetest.get_modpath("chat2") then
chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF) chat2.send_message(minetest.get_player_by_name(sender), S("You are not allowed to send requests because you're muted."), 0xFFFFFF)