core.usermanager: Correct formatting of not implemented error

Spaces, no hyphen, apparently.
This commit is contained in:
Kim Alvefur 2023-03-26 16:51:33 +02:00
parent 8720067f24
commit e53ef27a1c
2 changed files with 5 additions and 5 deletions

View file

@ -116,7 +116,7 @@ end
local function get_account_info(username, host) local function get_account_info(username, host)
local method = hosts[host].users.get_account_info; 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); return method(username);
end end
@ -144,7 +144,7 @@ local function user_is_enabled(username, host)
local info, err = get_account_info(username, host); local info, err = get_account_info(username, host);
if info and info.enabled ~= nil then if info and info.enabled ~= nil then
return info.enabled; return info.enabled;
elseif err ~= "method-not-implemented" then elseif err ~= "method not implemented" then
-- Storage issues etetc -- Storage issues etetc
return info, err; return info, err;
end end
@ -155,7 +155,7 @@ end
local function enable_user(username, host) local function enable_user(username, host)
local method = hosts[host].users.enable; 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); local ret, err = method(username);
if ret then if ret then
prosody.events.fire_event("user-enabled", { username = username, host = host }); prosody.events.fire_event("user-enabled", { username = username, host = host });
@ -165,7 +165,7 @@ end
local function disable_user(username, host) local function disable_user(username, host)
local method = hosts[host].users.disable; 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); local ret, err = method(username);
if ret then if ret then
prosody.events.fire_event("user-disabled", { username = username, host = host }); prosody.events.fire_event("user-disabled", { username = username, host = host });

View file

@ -1535,7 +1535,7 @@ function def_env.user:create(jid, password, role)
end end
local ok, err = um.enable_user(username, host); 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; return nil, "Could not enable user: "..err;
end end
end end