aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_socket.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2025-01-07 18:16:23 +0000
committerMatthew Wild <mwild1@gmail.com>2025-01-07 18:16:23 +0000
commit72b6c110f0c695f5fcaaab2edfa6ad9db37b1f09 (patch)
treebf3ac8c390b1f21bd121681c2d2c4042e302f2d6 /plugins/mod_admin_socket.lua
parent957c69461fc3d13ef945cb0ccd62b601f18f2e9a (diff)
downloadprosody-72b6c110f0c695f5fcaaab2edfa6ad9db37b1f09.tar.gz
prosody-72b6c110f0c695f5fcaaab2edfa6ad9db37b1f09.zip
mod_admin_socket: Fire event on admin client disconnect
Diffstat (limited to 'plugins/mod_admin_socket.lua')
-rw-r--r--plugins/mod_admin_socket.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_admin_socket.lua b/plugins/mod_admin_socket.lua
index ad6aa5d7..b7b6d5f5 100644
--- a/plugins/mod_admin_socket.lua
+++ b/plugins/mod_admin_socket.lua
@@ -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...");