ping-timeout.lua: fix message parsing

This commit is contained in:
Přemysl Eric Janouch 2016-04-20 23:32:00 +02:00
parent 4665807d09
commit 29418e5e55
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
-- --
-- ping-timeout.lua: ping timeout readability enhancement plugin -- ping-timeout.lua: ping timeout readability enhancement plugin
-- --
-- Copyright (c) 2015, Přemysl Janouch <p.janouch@gmail.com> -- Copyright (c) 2015 - 2016, Přemysl Janouch <p.janouch@gmail.com>
-- --
-- Permission to use, copy, modify, and/or distribute this software for any -- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above -- purpose with or without fee is hereby granted, provided that the above
@ -17,9 +17,9 @@
-- --
degesch.hook_irc (function (hook, server, line) degesch.hook_irc (function (hook, server, line)
local start, timeout = local msg = degesch.parse (line)
line:match ("^(:[^ ]* QUIT :Ping timeout:) (%d+) seconds$") local start, timeout = line:match ("^(.* :Ping timeout:) (%d+) seconds$")
if not start then if msg.command ~= "QUIT" or not start then
return line return line
end end