From 105db6bc602ba5bd61a723431f85892347b91146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Mart=C3=ADnez?= Date: Tue, 8 Jan 2013 22:50:56 -0200 Subject: [PATCH] Added message when a user joins or parts the channel --- src/callback.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/callback.lua b/src/callback.lua index fe41f93..f9a063f 100644 --- a/src/callback.lua +++ b/src/callback.lua @@ -109,6 +109,20 @@ irc.register_callback("nick_change", function ( from, old_nick ) end end); +irc.register_callback("join", function ( servinfo, from ) + local text = "*** "..from.." joined "..mt_irc.channel; + for k, v in pairs(mt_irc.connected_players) do + if (v) then minetest.chat_send_player(k, text); end + end +end); + +irc.register_callback("part", function ( servinfo, from, part_msg ) + local text = "*** "..from.." left "..mt_irc.channel.." ("..part_msg..")"; + for k, v in pairs(mt_irc.connected_players) do + if (v) then minetest.chat_send_player(k, text); end + end +end); + irc.register_callback("channel_act", function ( servinfo, from, message) if (not mt_irc.connect_ok) then return; end local text = "*** "..from.." "..message;