6
|
1 local Luan = require "luan:Luan.luan"
|
|
2 local error = Luan.error
|
|
3 local Io = require "luan:Io.luan"
|
|
4 local Http = require "luan:http/Http.luan"
|
|
5 local User = require "site:/lib/User.luan"
|
|
6 local current_user = User.current or error()
|
17
|
7 local Shared = require "site:/lib/Shared.luan"
|
|
8 local http_push_to_users = Shared.http_push_to_users or error()
|
|
9 local Logging = require "luan:logging/Logging.luan"
|
|
10 local logger = Logging.logger "delete_user.js"
|
6
|
11
|
|
12
|
|
13 return function()
|
|
14 local user = current_user()
|
|
15 if user ~= nil then
|
33
|
16 local user_ids = user.chatting_with_ids()
|
17
|
17 local js = "getChats(null)"
|
6
|
18 user.delete()
|
17
|
19 http_push_to_users( user_ids, js )
|
6
|
20 end
|
|
21 Io.stdout = Http.response.text_writer()
|
|
22 %>
|
|
23 logout();
|
|
24 <%
|
|
25 end
|