aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjluehrs2 <jluehrs2@uiuc.edu>2007-09-04 15:07:32 -0500
committerjluehrs2 <jluehrs2@uiuc.edu>2007-09-04 15:07:32 -0500
commit7b7a24c3f27b74e95c24e62917bcc4ba8478196d (patch)
treed7e89db7c5c66eb7a2b1b94d5687930e77044e12
parentb1ad48eb6ae9bf3aa9d03968ad54da6dffdc5fef (diff)
downloadluairc-7b7a24c3f27b74e95c24e62917bcc4ba8478196d.tar.gz
luairc-7b7a24c3f27b74e95c24e62917bcc4ba8478196d.zip
there shouldn't ever be a reason to not want to strip ctcp quoting off when splitting, so remove that option
-rw-r--r--src/irc.lua4
-rw-r--r--src/irc/ctcp.lua12
2 files changed, 6 insertions, 10 deletions
diff --git a/src/irc.lua b/src/irc.lua
index 3d7d68f..761039b 100644
--- a/src/irc.lua
+++ b/src/irc.lua
@@ -225,7 +225,7 @@ end
-- on_privmsg {{{
function handlers.on_privmsg(from, to, msg)
- local msgs = ctcp._ctcp_split(msg, true)
+ local msgs = ctcp._ctcp_split(msg)
for _, v in base.ipairs(msgs) do
if base.type(v) == "string" then
-- normal message {{{
@@ -258,7 +258,7 @@ end
-- on_notice {{{
function handlers.on_notice(from, to, msg)
- local msgs = ctcp._ctcp_split(msg, true)
+ local msgs = ctcp._ctcp_split(msg)
for _, v in base.ipairs(msgs) do
if base.type(v) == "string" then
-- normal message {{{
diff --git a/src/irc/ctcp.lua b/src/irc/ctcp.lua
index 97b880d..1866122 100644
--- a/src/irc/ctcp.lua
+++ b/src/irc/ctcp.lua
@@ -73,12 +73,12 @@ end
-- _ctcp_split {{{
-- TODO: again with this string/table thing... it's ugly!
--
--- Splits a low level dequoted string into normal text and CTCP messages.
+-- Splits a low level dequoted string into normal text and unquoted CTCP
+-- messages.
-- @param str Low level dequoted string
--- @param dequote If true, the CTCP messages will also be CTCP dequoted
-- @return Array, where string values correspond to plain text, and table
-- values have t[1] as the CTCP message
-function _ctcp_split(str, dequote)
+function _ctcp_split(str)
local ret = {}
local iter = 1
while true do
@@ -97,11 +97,7 @@ function _ctcp_split(str, dequote)
end
if not s then break end
if ctcp_string ~= "" then
- if dequote then
- table.insert(ret, {_ctcp_dequote(ctcp_string)})
- else
- table.insert(ret, {ctcp_string})
- end
+ table.insert(ret, {_ctcp_dequote(ctcp_string)})
end
iter = e + 1