From 72b6c110f0c695f5fcaaab2edfa6ad9db37b1f09 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Tue, 7 Jan 2025 18:16:23 +0000 Subject: mod_admin_socket: Fire event on admin client disconnect --- plugins/mod_admin_socket.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'plugins/mod_admin_socket.lua') 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..."); -- cgit v1.2.3