# HG changeset patch # User Matthew Wild # Date 1680790869 -3600 # Node ID f370ccb15f055c97ccb661d0d39ac80d39b8fe71 # Parent 2bb27dfd10d5ce8ef4099b8277da73d92989a3ea mod_client_management: Fix user:clients() shell command to take a JID diff -r 2bb27dfd10d5 -r f370ccb15f05 mod_client_management/mod_client_management.lua --- a/mod_client_management/mod_client_management.lua Thu Apr 06 15:20:25 2023 +0100 +++ b/mod_client_management/mod_client_management.lua Thu Apr 06 15:21:09 2023 +0100 @@ -375,8 +375,15 @@ local console_env = module:shared("/*/admin_shell/env"); if not console_env.user then return; end -- admin_shell probably not loaded - function console_env.user:clients(username) - local clients = get_active_clients(username); + function console_env.user:clients(user_jid) + local username, host = jid.split(user_jid); + local mod = prosody.hosts[host] and prosody.hosts[host].modules.client_management; + if not mod then + print("EE: Host does not exist on this server, or does not have mod_client_management loaded"); + return 1; + end + + local clients = mod.get_active_clients(username); if not clients or #clients == 0 then return true, "No clients associated with this account"; end