aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_admin_shell.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_admin_shell.lua')
-rw-r--r--plugins/mod_admin_shell.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua
index e6b44f00..3738b8ba 100644
--- a/plugins/mod_admin_shell.lua
+++ b/plugins/mod_admin_shell.lua
@@ -1770,7 +1770,11 @@ function def_env.user:setrole(jid, host, new_role)
elseif prosody.hosts[userhost] and not um.user_exists(username, userhost) then
return nil, "No such user";
end
- return um.set_user_role(username, host, new_role);
+ if userhost == host then
+ return um.set_user_role(username, userhost, new_role);
+ else
+ return um.set_jid_role(jid, host, new_role);
+ end
end
describe_command [[user:addrole(jid, host, role) - Add a secondary role to a user]]