From 29418e5e55dfcebee03c50a69064a432fb8e6197 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Wed, 20 Apr 2016 23:32:00 +0200
Subject: ping-timeout.lua: fix message parsing
---
plugins/degesch/ping-timeout.lua | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'plugins/degesch')
diff --git a/plugins/degesch/ping-timeout.lua b/plugins/degesch/ping-timeout.lua
index 12a5221..f871f42 100644
--- a/plugins/degesch/ping-timeout.lua
+++ b/plugins/degesch/ping-timeout.lua
@@ -1,7 +1,7 @@
--
-- ping-timeout.lua: ping timeout readability enhancement plugin
--
--- Copyright (c) 2015, Přemysl Janouch
+-- Copyright (c) 2015 - 2016, Přemysl Janouch
--
-- Permission to use, copy, modify, and/or distribute this software for any
-- purpose with or without fee is hereby granted, provided that the above
@@ -17,9 +17,9 @@
--
degesch.hook_irc (function (hook, server, line)
- local start, timeout =
- line:match ("^(:[^ ]* QUIT :Ping timeout:) (%d+) seconds$")
- if not start then
+ local msg = degesch.parse (line)
+ local start, timeout = line:match ("^(.* :Ping timeout:) (%d+) seconds$")
+ if msg.command ~= "QUIT" or not start then
return line
end
--
cgit v1.2.3-70-g09d2