Mercurial Hosting > chat
comparison src/delete_chat.js.luan @ 56:323ddacc1593
start invite
| author | Franklin Schmidt <fschmidt@gmail.com> |
|---|---|
| date | Tue, 04 Mar 2025 07:00:42 -0700 |
| parents | 7230c821c368 |
| children |
comparison
equal
deleted
inserted
replaced
| 55:d21ae4920aac | 56:323ddacc1593 |
|---|---|
| 1 local Luan = require "luan:Luan.luan" | 1 local Luan = require "luan:Luan.luan" |
| 2 local error = Luan.error | 2 local error = Luan.error |
| 3 local Io = require "luan:Io.luan" | |
| 3 local Http = require "luan:http/Http.luan" | 4 local Http = require "luan:http/Http.luan" |
| 4 local User = require "site:/lib/User.luan" | 5 local User = require "site:/lib/User.luan" |
| 5 local current_user = User.current or error() | 6 local current_user = User.current or error() |
| 6 local Chat = require "site:/lib/Chat.luan" | 7 local Chat = require "site:/lib/Chat.luan" |
| 7 local get_chat_by_id = Chat.get_by_id or error() | 8 local get_chat_by_id = Chat.get_by_id or error() |
| 18 local user = current_user() or error() | 19 local user = current_user() or error() |
| 19 is_in_list( user.id, user_ids ) or error() | 20 is_in_list( user.id, user_ids ) or error() |
| 20 chat.delete() | 21 chat.delete() |
| 21 local js = "getChats(null)" | 22 local js = "getChats(null)" |
| 22 http_push_to_users( user_ids, js ) | 23 http_push_to_users( user_ids, js ) |
| 24 Io.stdout = Http.response.text_writer() | |
| 25 %> | |
| 26 location = '/'; | |
| 27 <% | |
| 23 end | 28 end |
