40
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
54
|
3 local Http = require "luan:http/Http.luan"
|
40
|
4 local User = require "site:/lib/User.luan"
|
|
5 local current_user = User.current or error()
|
54
|
6 local Chat = require "site:/lib/Chat.luan"
|
|
7 local get_chat_by_id = Chat.get_by_id or error()
|
40
|
8
|
|
9
|
|
10 return function()
|
|
11 local user = current_user() or error()
|
54
|
12 local chat = Http.request.parameters.chat or error()
|
|
13 chat = get_chat_by_id(chat) or error()
|
|
14 chat.read(user)
|
40
|
15 end
|