Mercurial > prosody-modules
comparison mod_http_muc_log/mod_http_muc_log.lua @ 2593:b61b0ff1c0f9
mod_http_muc_log: Fix prev/next date finding
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Wed, 01 Mar 2017 20:34:17 +0100 |
parents | fb1987d4ac62 |
children | cd5781ca782d |
comparison
equal
deleted
inserted
replaced
2592:fb1987d4ac62 | 2593:b61b0ff1c0f9 |
---|---|
223 end | 223 end |
224 end | 224 end |
225 else | 225 else |
226 | 226 |
227 module:log("debug", "Find next date with messages"); | 227 module:log("debug", "Find next date with messages"); |
228 local next_when = find_once(room, { after = last }, 3); | 228 next_when = find_once(room, { after = last }, 3); |
229 if next_when then | 229 if next_when then |
230 next_when = datetime.date(next_when); | 230 next_when = datetime.date(next_when); |
231 module:log("debug", "Next message: %s", next_when); | 231 module:log("debug", "Next message: %s", next_when); |
232 else | 232 else |
233 next_when = ""; | 233 next_when = ""; |
234 end | 234 end |
235 | 235 |
236 module:log("debug", "Find prev date with messages"); | 236 module:log("debug", "Find prev date with messages"); |
237 local prev_when = find_once(room, { before = first, reverse = true }, 3); | 237 prev_when = find_once(room, { before = first, reverse = true }, 3); |
238 if prev_when then | 238 if prev_when then |
239 prev_when = datetime.date(prev_when); | 239 prev_when = datetime.date(prev_when); |
240 module:log("debug", "Previous message: %s", prev_when); | 240 module:log("debug", "Previous message: %s", prev_when); |
241 else | 241 else |
242 prev_when = ""; | 242 prev_when = ""; |