Comparison

mod_http_muc_log/mod_http_muc_log.lua @ 1671:c813b69ae279

mod_http_muc_log: Fix passing dates trough util.datetime twice;
author Kim Alvefur <zash@zash.se>
date Sat, 11 Apr 2015 21:43:32 +0200
parent 1654:1a6d6221c5f6
child 1750:3b839db88412
comparison
equal deleted inserted replaced
1670:5f5ff061b316 1671:c813b69ae279
236 236
237 module:log("debug", "Find next date with messages"); 237 module:log("debug", "Find next date with messages");
238 local next_when = find_once(room, { after = last }, 3); 238 local next_when = find_once(room, { after = last }, 3);
239 if next_when then 239 if next_when then
240 next_when = datetime.date(next_when); 240 next_when = datetime.date(next_when);
241 module:log("debug", "Next message: %s", datetime.datetime(next_when)); 241 module:log("debug", "Next message: %s", next_when);
242 else 242 else
243 next_when = ""; 243 next_when = "";
244 end 244 end
245 245
246 module:log("debug", "Find prev date with messages"); 246 module:log("debug", "Find prev date with messages");
247 local prev_when = find_once(room, { before = first, reverse = true }, 3); 247 local prev_when = find_once(room, { before = first, reverse = true }, 3);
248 if prev_when then 248 if prev_when then
249 prev_when = datetime.date(prev_when); 249 prev_when = datetime.date(prev_when);
250 module:log("debug", "Previous message: %s", datetime.datetime(prev_when)); 250 module:log("debug", "Previous message: %s", prev_when);
251 else 251 else
252 prev_when = ""; 252 prev_when = "";
253 end 253 end
254 254
255 response.headers.content_type = "text/html; charset=utf-8"; 255 response.headers.content_type = "text/html; charset=utf-8";