mod_http_muc_log/mod_http_muc_log.lua
changeset 3596 61a9c087730a
parent 3595 3f8383c5a045
child 3597 0b670831ace3
equal deleted inserted replaced
3595:3f8383c5a045 3596:61a9c087730a
   241 	if is_open == nil then
   241 	if is_open == nil then
   242 		return -- implicit 404
   242 		return -- implicit 404
   243 	elseif is_open == false then
   243 	elseif is_open == false then
   244 		return 403;
   244 		return 403;
   245 	end
   245 	end
       
   246 	if date == "latest" then
       
   247 		local last_day = find_once(room, { reverse = true }, 3);
       
   248 		response.headers.location = datetime.date(last_day);
       
   249 		return 303;
       
   250 	end
   246 	local day_start = datetime.parse(date.."T00:00:00Z");
   251 	local day_start = datetime.parse(date.."T00:00:00Z");
   247 	if not day_start then
   252 	if not day_start then
   248 		module:log("debug", "Invalid date format: %q", date);
   253 		module:log("debug", "Invalid date format: %q", date);
   249 		return 400;
   254 		return 400;
   250 	end
   255 	end