Mercurial Hosting > chat
comparison src/lib/Chat.luan @ 46:42b741a1d5c6
add username
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Fri, 28 Feb 2025 19:25:12 -0700 |
| parents | e2b7f6393dab |
| children | 9298b04607ae |
comparison
equal
deleted
inserted
replaced
| 45:e138343b2c76 | 46:42b741a1d5c6 |
|---|---|
| 50 function chat.http_push(message) | 50 function chat.http_push(message) |
| 51 local url = base_url().."/chat/"..chat.id | 51 local url = base_url().."/chat/"..chat.id |
| 52 Http.push(url,message) | 52 Http.push(url,message) |
| 53 end | 53 end |
| 54 | 54 |
| 55 function chat.other_user_id(my_id) | |
| 56 for _, user_id in ipairs(chat.user_ids) do | |
| 57 if user_id ~= my_id then | |
| 58 return user_id | |
| 59 end | |
| 60 end | |
| 61 error() | |
| 62 end | |
| 63 | |
| 55 return chat | 64 return chat |
| 56 end | 65 end |
| 57 | 66 |
| 58 function Chat.search(query,sort,rows) | 67 function Chat.search(query,sort,rows) |
| 59 rows = rows or 1000000 | 68 rows = rows or 1000000 |
