mod_client_management: Include session in the other new-client event too
authorKim Alvefur <zash@zash.se>
Sat, 02 Dec 2023 11:18:57 +0100
changeset 5760 e199f33f7a2e
parent 5759 4a353ccce220
child 5761 08a635862201
mod_client_management: Include session in the other new-client event too
mod_client_management/mod_client_management.lua
--- a/mod_client_management/mod_client_management.lua	Sat Dec 02 11:10:43 2023 +0100
+++ b/mod_client_management/mod_client_management.lua	Sat Dec 02 11:18:57 2023 +0100
@@ -133,7 +133,7 @@
 	client_store:set_key(session.username, client_state.id, client_state);
 
 	if is_new_client then
-		module:fire_event("client_management/new-client", { client = client_state });
+		module:fire_event("client_management/new-client", { client = client_state; session = session });
 	end
 end);
 
@@ -425,7 +425,7 @@
 
 -- Command
 
-module:once(function ()
+module:on_ready(function ()
 	local console_env = module:shared("/*/admin_shell/env");
 	if not console_env.user then return; end -- admin_shell probably not loaded