From ad11b33cee8f96a97f657a7dfd054340c2ab94b3 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Sat, 14 Apr 2018 09:54:35 +1200 Subject: [PATCH] Allow cloaked players to receive IRC messages Override irc.sendLocal() to send messages to cloaked players. --- init.lua | 4 ++++ irc.lua | 14 ++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 irc.lua diff --git a/init.lua b/init.lua index 6e53735..aeec541 100644 --- a/init.lua +++ b/init.lua @@ -10,3 +10,7 @@ dofile(path .. '/chatcommands.lua') if chat3 then dofile(path .. '/chat3.lua') end + +if irc then + dofile(path .. '/irc.lua') +end diff --git a/irc.lua b/irc.lua new file mode 100644 index 0000000..9f5dd2e --- /dev/null +++ b/irc.lua @@ -0,0 +1,14 @@ +-- +-- Minetest cloaking mod: IRC fixes +-- +-- © 2018 by luk3yx +-- + +local irc_sendLocal = irc.sendLocal + +irc.sendLocal = function(msg) + for _, player in ipairs(cloaking.get_cloaked_players()) do + minetest.chat_send_player(player, msg) + end + return irc_sendLocal(msg) +end