Mercurial Hosting > lang
comparison src/lib/Chat.luan @ 65:ecb851fabd75
minor
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 22 Aug 2025 05:51:22 -0600 |
parents | 27758f3b2d69 |
children | f5e72f2d1025 |
comparison
equal
deleted
inserted
replaced
64:7fc224013c8b | 65:ecb851fabd75 |
---|---|
13 local Course = require "site:/lib/Course.luan" | 13 local Course = require "site:/lib/Course.luan" |
14 local get_course_by_id = Course.get_by_id or error() | 14 local get_course_by_id = Course.get_by_id or error() |
15 local Shared = require "site:/lib/Shared.luan" | 15 local Shared = require "site:/lib/Shared.luan" |
16 local voices = Shared.voices or error() | 16 local voices = Shared.voices or error() |
17 local languages = Shared.languages or error() | 17 local languages = Shared.languages or error() |
18 local User = require "site:/lib/User.luan" | |
19 local get_user_by_id = User.get_by_id or error() | |
18 | 20 |
19 | 21 |
20 local Chat = {} | 22 local Chat = {} |
21 | 23 |
22 local function from_doc(doc) | 24 local function from_doc(doc) |
145 | 147 |
146 function chat.language_name() | 148 function chat.language_name() |
147 return languages[chat.language] | 149 return languages[chat.language] |
148 end | 150 end |
149 | 151 |
152 function chat.get_user() | |
153 return get_user_by_id(chat.user_id) | |
154 end | |
155 | |
150 return chat | 156 return chat |
151 end | 157 end |
152 | 158 |
153 function Chat.search(query,sort,rows) | 159 function Chat.search(query,sort,rows) |
154 rows = rows or 1000000 | 160 rows = rows or 1000000 |