Comparison

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
parent 2590:63dd3e525f13
child 2592:fb1987d4ac62
comparison
equal deleted inserted replaced
2590:63dd3e525f13 2591:3e1a85c5194c
182 module:log("warn", "Could not search archive: %s", err or "no error"); 182 module:log("warn", "Could not search archive: %s", err or "no error");
183 return 500; 183 return 500;
184 end 184 end
185 185
186 local first, last; 186 local first, last;
187 local verb, subject, body;
188 for key, item, when in iter do 187 for key, item, when in iter do
189 body = item:get_child_text("body"); 188 local body = item:get_child_text("body");
190 subject = item:get_child_text("subject"); 189 local subject = item:get_child_text("subject");
191 verb = nil; 190 local verb = nil;
192 if subject then 191 if subject then
193 verb, body = "set the topic to", subject; 192 verb, body = "set the topic to", subject;
194 elseif body and body:sub(1,4) == "/me " then 193 elseif body and body:sub(1,4) == "/me " then
195 verb, body = body:sub(5), nil; 194 verb, body = body:sub(5), nil;
196 elseif item.name == "presence" then 195 elseif item.name == "presence" then