diff mod_client_management/mod_client_management.lua @ 5372:2d8076577e14

mod_client_management: Fix error when called against host without this module Previously: prosody> user:clients("user@example.org") | Result: 1
author Kim Alvefur <zash@zash.se>
date Wed, 26 Apr 2023 12:09:17 +0200
parents b2d51c6ae89a
children 93d6ed7dc779
line wrap: on
line diff
--- 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);