Comparison

mod_http_muc_log/mod_http_muc_log.lua @ 2842:263c0b044973

mod_http_muc_log: Remove redundant else clauses
author Kim Alvefur <zash@zash.se>
date Tue, 21 Nov 2017 00:06:59 +0100
parent 2841:462dece0a3c2
child 2843:53a76c994fc3
comparison
equal deleted inserted replaced
2841:462dece0a3c2 2842:263c0b044973
247 module:log("debug", "Find next date with messages"); 247 module:log("debug", "Find next date with messages");
248 next_when = find_once(room, { after = last }, 3); 248 next_when = find_once(room, { after = last }, 3);
249 if next_when then 249 if next_when then
250 next_when = datetime.date(next_when); 250 next_when = datetime.date(next_when);
251 module:log("debug", "Next message: %s", next_when); 251 module:log("debug", "Next message: %s", next_when);
252 else
253 next_when = "";
254 end 252 end
255 253
256 module:log("debug", "Find prev date with messages"); 254 module:log("debug", "Find prev date with messages");
257 prev_when = find_once(room, { before = first, reverse = true }, 3); 255 prev_when = find_once(room, { before = first, reverse = true }, 3);
258 if prev_when then 256 if prev_when then
259 prev_when = datetime.date(prev_when); 257 prev_when = datetime.date(prev_when);
260 module:log("debug", "Previous message: %s", prev_when); 258 module:log("debug", "Previous message: %s", prev_when);
261 else
262 prev_when = "";
263 end 259 end
264 end 260 end
265 261
266 response.headers.content_type = "text/html; charset=utf-8"; 262 response.headers.content_type = "text/html; charset=utf-8";
267 return render(template, { 263 return render(template, {