Changeset

12993:623fbb5f9b05

core.usermanager: Correct formatting of not implemented error Spaces, no hyphen, apparently.
author Kim Alvefur <zash@zash.se>
date Sun, 26 Mar 2023 16:51:33 +0200
parents 12992:651813914151
children 12994:5625da6ae6b6
files core/usermanager.lua plugins/mod_admin_shell.lua
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/core/usermanager.lua	Sun Mar 26 16:45:34 2023 +0200
+++ b/core/usermanager.lua	Sun Mar 26 16:51:33 2023 +0200
@@ -116,7 +116,7 @@
 
 local function get_account_info(username, host)
 	local method = hosts[host].users.get_account_info;
-	if not method then return nil, "method-not-supported"; end
+	if not method then return nil, "method not supported"; end
 	return method(username);
 end
 
@@ -144,7 +144,7 @@
 	local info, err = get_account_info(username, host);
 	if info and info.enabled ~= nil then
 		return info.enabled;
-	elseif err ~= "method-not-implemented" then
+	elseif err ~= "method not implemented" then
 		-- Storage issues etetc
 		return info, err;
 	end
@@ -155,7 +155,7 @@
 
 local function enable_user(username, host)
 	local method = hosts[host].users.enable;
-	if not method then return nil, "method-not-supported"; end
+	if not method then return nil, "method not supported"; end
 	local ret, err = method(username);
 	if ret then
 		prosody.events.fire_event("user-enabled", { username = username, host = host });
@@ -165,7 +165,7 @@
 
 local function disable_user(username, host)
 	local method = hosts[host].users.disable;
-	if not method then return nil, "method-not-supported"; end
+	if not method then return nil, "method not supported"; end
 	local ret, err = method(username);
 	if ret then
 		prosody.events.fire_event("user-disabled", { username = username, host = host });
--- a/plugins/mod_admin_shell.lua	Sun Mar 26 16:45:34 2023 +0200
+++ b/plugins/mod_admin_shell.lua	Sun Mar 26 16:51:33 2023 +0200
@@ -1535,7 +1535,7 @@
 			end
 
 			local ok, err = um.enable_user(username, host);
-			if not ok and err ~= "method-not-implemented" then
+			if not ok and err ~= "method not implemented" then
 				return nil, "Could not enable user: "..err;
 			end
 		end