aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-10-10 17:57:34 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-10-10 17:58:33 +0200
commit270d9017e9dec35ed82b7f4bc6fb40b814e8b339 (patch)
tree9cabddaa147ecd2d0239090bef969598624ff5c5 /plugins
parentee5cac4f217f811070c532fe53c4ff8ae7590b99 (diff)
downloadxK-270d9017e9dec35ed82b7f4bc6fb40b814e8b339.tar.gz
xK-270d9017e9dec35ed82b7f4bc6fb40b814e8b339.tar.xz
xK-270d9017e9dec35ed82b7f4bc6fb40b814e8b339.zip
degesch: improve ad-hoc IRC parsers in plugins
Diffstat (limited to 'plugins')
-rw-r--r--plugins/degesch/censor.lua2
-rw-r--r--plugins/degesch/slack.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/degesch/censor.lua b/plugins/degesch/censor.lua
index d28ca83..a768aed 100644
--- a/plugins/degesch/censor.lua
+++ b/plugins/degesch/censor.lua
@@ -49,7 +49,7 @@ degesch.setup_config {
local censor = function (line)
-- Taking a shortcut to avoid lengthy message reassembly
- local start, text = line:match ("^(.- PRIVMSG .-:)(.*)$")
+ local start, text = line:match ("^(.- PRIVMSG .- :)(.*)$")
local ctcp, rest = text:match ("^(\x01%g+ )(.*)")
text = ctcp and ctcp .. "\x0301,01" .. rest or "\x0301,01" .. text
return start .. text
diff --git a/plugins/degesch/slack.lua b/plugins/degesch/slack.lua
index 5600a8f..dcddb3c 100644
--- a/plugins/degesch/slack.lua
+++ b/plugins/degesch/slack.lua
@@ -91,7 +91,7 @@ end)
degesch.hook_irc (function (hook, server, line)
if not servers[server.name] then return line end
if unemojify then
- local start, text = line:match ("^(.- PRIVMSG .-:)(.*)$")
+ local start, text = line:match ("^(.- PRIVMSG .- :)(.*)$")
if start then return start .. text:gsub (":([a-z_]+):", function (name)
if emoji[name] then return emoji[name] end
return ":" .. name .. ":"