mod_client_management: Fix error when called against host without this module
authorKim Alvefur <zash@zash.se>
Wed, 26 Apr 2023 12:09:17 +0200
changeset 5376 2d8076577e14
parent 5375 b2d51c6ae89a
child 5377 93d6ed7dc779
mod_client_management: Fix error when called against host without this module Previously: prosody> user:clients("user@example.org") | Result: 1
mod_client_management/mod_client_management.lua
--- a/mod_client_management/mod_client_management.lua	Wed Apr 26 11:55:55 2023 +0200
+++ b/mod_client_management/mod_client_management.lua	Wed Apr 26 12:09:17 2023 +0200
@@ -409,8 +409,7 @@
 		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;
+			return false, ("Host does not exist on this server, or does not have mod_client_management loaded");
 		end
 
 		local clients = mod.get_active_clients(username);