mod_http_muc_log/mod_http_muc_log.lua
changeset 5594 b681948a01f1
parent 5585 df483d9056f5
child 5660 c20b77e5e032
equal deleted inserted replaced
5593:7040d0772758 5594:b681948a01f1
   292 
   292 
   293 -- Produce the chat log view
   293 -- Produce the chat log view
   294 local function logs_page(event, path)
   294 local function logs_page(event, path)
   295 	local request, response = event.request, event.response;
   295 	local request, response = event.request, event.response;
   296 
   296 
   297 	local room, date = path:match("^([^/]+)/([^/]*)/?$");
   297 	-- /room --> 303 /room/
   298 	if not room then
   298 	-- /room/ --> calendar view
       
   299 	-- /room/yyyy-mm-dd --> logs view
       
   300 	-- /room/yyyy-mm-dd/* --> 404
       
   301 	local room, date = path:match("^([^/]+)/([^/]*)$");
       
   302 	if not room and not path:find"/" then
   299 		response.headers.location = url.build({ path = path .. "/" });
   303 		response.headers.location = url.build({ path = path .. "/" });
   300 		return 303;
   304 		return 303;
       
   305 	elseif not room then
       
   306 		return 404;
   301 	end
   307 	end
   302 	room = nodeprep(room);
   308 	room = nodeprep(room);
   303 	if not room then
   309 	if not room then
   304 		return 400;
   310 		return 400;
   305 	elseif date == "" then
   311 	elseif date == "" then