# HG changeset patch # User Kim Alvefur # Date 1557699784 -7200 # Node ID 61a9c087730a2645e61466026f17115b0b1726d8 # Parent 3f8383c5a045817441c87c824fa6c50fb6d138a0 mod_http_muc_log: Provide a redirect to 'latest' day with logs (fixes #1360) diff -r 3f8383c5a045 -r 61a9c087730a mod_http_muc_log/mod_http_muc_log.lua --- a/mod_http_muc_log/mod_http_muc_log.lua Mon May 13 00:20:19 2019 +0200 +++ b/mod_http_muc_log/mod_http_muc_log.lua Mon May 13 00:23:04 2019 +0200 @@ -243,6 +243,11 @@ elseif is_open == false then return 403; end + if date == "latest" then + local last_day = find_once(room, { reverse = true }, 3); + response.headers.location = datetime.date(last_day); + return 303; + end local day_start = datetime.parse(date.."T00:00:00Z"); if not day_start then module:log("debug", "Invalid date format: %q", date);