aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_socket.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_admin_socket.lua')
-rw-r--r--plugins/mod_admin_socket.lua15
1 files changed, 10 insertions, 5 deletions
diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua
index 157e746c..b7b6d5f5 100644
--- a/plugins/mod_admin_socket.lua
+++ b/plugins/mod_admin_socket.lua
@@ -8,7 +8,7 @@ if have_unix and type(unix) == "function" then
-- constructor was exported instead of a module table. Due to the lack of a
-- proper release of LuaSocket, distros have settled on shipping either the
-- last RC tag or some commit since then.
- -- Here we accomodate both variants.
+ -- Here we accommodate both variants.
unix = { stream = unix };
end
if not have_unix or type(unix) ~= "table" then
@@ -16,10 +16,10 @@ if not have_unix or type(unix) ~= "table" then
return;
end
-local server = require "net.server";
+local server = require "prosody.net.server";
-local adminstream = require "util.adminstream";
-local st = require "util.stanza";
+local adminstream = require "prosody.util.adminstream";
+local st = require "prosody.util.stanza";
local socket_path = module:get_option_path("admin_socket", "prosody.sock", "data");
@@ -54,7 +54,12 @@ end);
local conn, sock;
-local listeners = adminstream.server(sessions, fire_admin_event).listeners;
+local admin_server = adminstream.server(sessions, fire_admin_event);
+local listeners = admin_server.listeners;
+
+module:hook_object_event(admin_server.events, "disconnected", function (event)
+ return module:fire_event("admin-disconnected", event);
+end);
local function accept_connection()
module:log("debug", "accepting...");