diff mod_http_muc_log/mod_http_muc_log.lua @ 2591:3e1a85c5194c

mod_http_muc_log: Move scope of variables into loop
author Kim Alvefur <zash@zash.se>
date Wed, 01 Mar 2017 20:31:08 +0100
parents 63dd3e525f13
children fb1987d4ac62
line wrap: on
line diff
--- a/mod_http_muc_log/mod_http_muc_log.lua	Wed Mar 01 20:29:40 2017 +0100
+++ b/mod_http_muc_log/mod_http_muc_log.lua	Wed Mar 01 20:31:08 2017 +0100
@@ -184,11 +184,10 @@
 	end
 
 	local first, last;
-	local verb, subject, body;
 	for key, item, when in iter do
-		body = item:get_child_text("body");
-		subject = item:get_child_text("subject");
-		verb = nil;
+		local body = item:get_child_text("body");
+		local subject = item:get_child_text("subject");
+		local verb = nil;
 		if subject then
 			verb, body = "set the topic to", subject;
 		elseif body and body:sub(1,4) == "/me " then