mod_adhoc: Simplify variable references
Since commands[node] was already stored in a local a few lines up
--- a/plugins/adhoc/mod_adhoc.lua Mon Mar 06 15:19:35 2017 +0100
+++ b/plugins/adhoc/mod_adhoc.lua Tue Mar 22 18:07:11 2022 +0100
@@ -79,12 +79,12 @@
or (command.permission == "global_admin" and not global_admin)
or (command.permission == "local_user" and hostname ~= module.host) then
origin.send(st.error_reply(stanza, "auth", "forbidden", "You don't have permission to execute this command"):up()
- :add_child(commands[node]:cmdtag("canceled")
+ :add_child(command:cmdtag("canceled")
:tag("note", {type="error"}):text("You don't have permission to execute this command")));
return true
end
-- User has permission now execute the command
- adhoc_handle_cmd(commands[node], origin, stanza);
+ adhoc_handle_cmd(command, origin, stanza);
return true;
end
end, 500);