Fixing regressions in sendChat and sendNotice.

Fixing: Incorrect handling of newlines in message.
Fixing: Cleaning ':' from message.
This commit is contained in:
Joshua Simmons 2010-07-18 17:24:13 +10:00
parent b370d8bfe7
commit 8114c5b7f8
1 changed files with 8 additions and 2 deletions

View File

@ -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)