mod_adhoc: Simplify variable references
authorKim Alvefur <zash@zash.se>
Tue, 22 Mar 2022 18:07:11 +0100
changeset 12434 0c1684c65716
parent 12433 16a49f04d507
child 12436 60eecdd9c65b
mod_adhoc: Simplify variable references Since commands[node] was already stored in a local a few lines up
plugins/adhoc/mod_adhoc.lua
--- 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);