From 861fd354eabf4482d3554c3c307c23c09caf31be Mon Sep 17 00:00:00 2001 From: jluehrs2 Date: Tue, 4 Sep 2007 15:44:39 -0500 Subject: make low_quote and ctcp_quote take multiple arguments, so they look cleaner --- src/irc/ctcp.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/irc/ctcp.lua b/src/irc/ctcp.lua index 5848416..c77cae8 100644 --- a/src/irc/ctcp.lua +++ b/src/irc/ctcp.lua @@ -15,9 +15,10 @@ module "irc.ctcp" -- -- Applies low level quoting to a string (escaping characters which are illegal -- to appear in an IRC packet). --- @param str String to quote +-- @param ... Strings to quote together, space separated -- @return Quoted string -function _low_quote(str) +function _low_quote(...) + local str = table.concat({...}, " ") return str:gsub("[%z\n\r\020]", {["\000"] = "\0200", ["\n"] = "\020n", ["\r"] = "\020r", @@ -45,9 +46,10 @@ end -- -- Applies CTCP quoting to a block of text which has been identified as CTCP -- data (by the calling program). --- @param str String to apply CTCP quoting to +-- @param ... Strings to apply CTCP quoting to together, space separated -- @return String with CTCP quoting applied -function _ctcp_quote(str) +function _ctcp_quote(...) + local str = table.concat({...}, " ") local ret = str:gsub("[\001\\]", {["\001"] = "\\a", ["\\"] = "\\\\"}) return "\001" .. ret .. "\001" -- cgit v1.2.3