From 9bf809f99a84db896e2a3312711c1d45c212e691 Mon Sep 17 00:00:00 2001 From: Joshua Simmons Date: Sun, 18 Jul 2010 15:24:13 +0800 Subject: [PATCH] Fixing regressions in sendChat and sendNotice. Fixing: Incorrect handling of newlines in message. Fixing: Cleaning ':' from message. --- asyncoperations.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/asyncoperations.lua b/asyncoperations.lua index 8d5827c..fc6f746 100644 --- a/asyncoperations.lua +++ b/asyncoperations.lua @@ -23,11 +23,17 @@ local function clean(str) end function meta:sendChat(target, msg) - self:send("PRIVMSG %s :%s", clean(target), clean(msg)) + -- Split the message into segments if it includes newlines. + for line in msg:gmatch("([^\r\n]+)") + self:send("PRIVMSG %s :%s", clean(target), msg) + end end function meta:sendNotice(target, msg) - self:send("NOTICE %s :%s", clean(target), clean(msg)) + -- Split the message into segments if it includes newlines. + for line in msg:gmatch("([^\r\n]+)") + self:send("NOTICE %s :%s", clean(target), msg) + end end function meta:join(channel, key)