equal
deleted
inserted
replaced
618 if node == "" then node = nil; end |
618 if node == "" then node = nil; end |
619 if day == "" then day = nil; end |
619 if day == "" then day = nil; end |
620 |
620 |
621 node = urldecode(node); |
621 node = urldecode(node); |
622 |
622 |
623 if not html.doc then |
623 if not html.doc then |
624 response.status_code = 500; |
624 response.status_code = 500; |
625 return response:send(handle_error(response.status_code, "Muc Theme is not loaded.")); |
625 return response:send(handle_error(response.status_code, "Muc Theme is not loaded.")); |
626 end |
626 end |
627 |
627 |
628 |
628 |
629 if node then room = hosts[my_host].modules.muc.rooms[node.."@"..my_host]; end |
629 if node then room = hosts[my_host].modules.muc.rooms[node.."@"..my_host]; end |
630 if node and not room then |
630 if node and not room then |
631 response.status_code = 404; |
631 response.status_code = 404; |
632 return response:send(handle_error(response.status_code, "Room doesn't exist.")); |
632 return response:send(handle_error(response.status_code, "Room doesn't exist.")); |
633 end |
633 end |
636 return response:send(handle_error(response.status_code, "There're no logs for this room.")); |
636 return response:send(handle_error(response.status_code, "There're no logs for this room.")); |
637 end |
637 end |
638 |
638 |
639 |
639 |
640 if not node then -- room list for component |
640 if not node then -- room list for component |
641 return response:send(create_doc(generate_room_list(my_host))); |
641 return response:send(create_doc(generate_room_list(my_host))); |
642 elseif not day then -- room's listing |
642 elseif not day then -- room's listing |
643 return response:send(create_doc(generate_day_room_content(node.."@"..my_host))); |
643 return response:send(create_doc(generate_day_room_content(node.."@"..my_host))); |
644 else |
644 else |
645 if not day:match("^20(%d%d)-(%d%d)-(%d%d)$") then |
645 if not day:match("^20(%d%d)-(%d%d)-(%d%d)$") then |
646 local y,m,d = day:match("^(%d%d)(%d%d)(%d%d)$"); |
646 local y,m,d = day:match("^(%d%d)(%d%d)(%d%d)$"); |