From 5604fa55827a73ddb0ffb1ac6f46d549a0d1084a Mon Sep 17 00:00:00 2001 From: kaeza Date: Wed, 8 Jan 2014 23:39:21 -0200 Subject: [PATCH] Send only first chat line. --- src/callback.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/callback.lua b/src/callback.lua index 847f481..c72fd59 100644 --- a/src/callback.lua +++ b/src/callback.lua @@ -26,6 +26,10 @@ minetest.register_on_chat_message(function(name, message) or (not minetest.check_player_privs(name, {shout=true})) then return end + local nl = message:find("\n", 1, true) + if nl then + message = message:sub(1, nl - 1) + end mt_irc:queueMsg(mt_irc.msgs.playerMessage( mt_irc.config.channel, name, message)) end)