Changeset

12430:0c1684c65716

mod_adhoc: Simplify variable references Since commands[node] was already stored in a local a few lines up
author Kim Alvefur <zash@zash.se>
date Tue, 22 Mar 2022 18:07:11 +0100
parents 12429:16a49f04d507
children 12432:60eecdd9c65b
files plugins/adhoc/mod_adhoc.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);