Mercurial Hosting > lang
comparison src/chat.html.luan @ 24:87fe70201aa8
courses work
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 31 Jul 2025 22:30:26 -0600 |
parents | 820136c5ee33 |
children | 3a80ddafe5a4 |
comparison
equal
deleted
inserted
replaced
23:0c17c233c45a | 24:87fe70201aa8 |
---|---|
5 local Shared = require "site:/lib/Shared.luan" | 5 local Shared = require "site:/lib/Shared.luan" |
6 local head = Shared.head or error() | 6 local head = Shared.head or error() |
7 local header = Shared.header or error() | 7 local header = Shared.header or error() |
8 local started = Shared.started or error() | 8 local started = Shared.started or error() |
9 local User = require "site:/lib/User.luan" | 9 local User = require "site:/lib/User.luan" |
10 local current_user = User.current or error() | 10 local current_user = User.current_required or error() |
11 local Chat = require "site:/lib/Chat.luan" | 11 local Chat = require "site:/lib/Chat.luan" |
12 local get_chat_by_id = Chat.get_by_id or error() | 12 local get_chat_by_id = Chat.get_by_id or error() |
13 | 13 |
14 | 14 |
15 return function() | 15 return function() |
16 local user = current_user() | 16 local user = current_user() |
17 if user == nil then | 17 if user == nil then return end |
18 Http.response.send_redirect("/login.html") | |
19 return | |
20 end | |
21 local chat_id = Http.request.parameters.chat or error() | 18 local chat_id = Http.request.parameters.chat or error() |
22 local chat = get_chat_by_id(chat_id) or error() | 19 local chat = get_chat_by_id(chat_id) or error() |
23 Io.stdout = Http.response.text_writer() | 20 Io.stdout = Http.response.text_writer() |
24 %> | 21 %> |
25 <!doctype html> | 22 <!doctype html> |