Changeset

8472:d88dc6827675

adhoc.lib: Rename other variable to avoid name clash [luacheck]
author Kim Alvefur <zash@zash.se>
date Tue, 12 Dec 2017 17:51:12 +0100
parents 8471:a6f58305411e
children 8473:f024cb5acc25
files plugins/adhoc/adhoc.lib.lua
diffstat 1 files changed, 12 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/adhoc/adhoc.lib.lua	Tue Dec 12 17:49:30 2017 +0100
+++ b/plugins/adhoc/adhoc.lib.lua	Tue Dec 12 17:51:12 2017 +0100
@@ -36,30 +36,30 @@
 
 	local data, state = command:handler(dataIn, states[sessionid]);
 	states[sessionid] = state;
-	local cmdtag;
+	local cmdreply;
 	if data.status == "completed" then
 		states[sessionid] = nil;
-		cmdtag = command:cmdtag("completed", sessionid);
+		cmdreply = command:cmdtag("completed", sessionid);
 	elseif data.status == "canceled" then
 		states[sessionid] = nil;
-		cmdtag = command:cmdtag("canceled", sessionid);
+		cmdreply = command:cmdtag("canceled", sessionid);
 	elseif data.status == "error" then
 		states[sessionid] = nil;
 		local reply = st.error_reply(stanza, data.error.type, data.error.condition, data.error.message);
 		origin.send(reply);
 		return true;
 	else
-		cmdtag = command:cmdtag("executing", sessionid);
+		cmdreply = command:cmdtag("executing", sessionid);
 		data.actions = data.actions or { "complete" };
 	end
 
 	for name, content in pairs(data) do
 		if name == "info" then
-			cmdtag:tag("note", {type="info"}):text(content):up();
+			cmdreply:tag("note", {type="info"}):text(content):up();
 		elseif name == "warn" then
-			cmdtag:tag("note", {type="warn"}):text(content):up();
+			cmdreply:tag("note", {type="warn"}):text(content):up();
 		elseif name == "error" then
-			cmdtag:tag("note", {type="error"}):text(content.message):up();
+			cmdreply:tag("note", {type="error"}):text(content.message):up();
 		elseif name == "actions" then
 			local actions = st.stanza("actions", { execute = content.default });
 			for _, action in ipairs(content) do
@@ -70,17 +70,17 @@
 						command.name, command.node, action);
 				end
 			end
-			cmdtag:add_child(actions);
+			cmdreply:add_child(actions);
 		elseif name == "form" then
-			cmdtag:add_child((content.layout or content):form(content.values));
+			cmdreply:add_child((content.layout or content):form(content.values));
 		elseif name == "result" then
-			cmdtag:add_child((content.layout or content):form(content.values, "result"));
+			cmdreply:add_child((content.layout or content):form(content.values, "result"));
 		elseif name == "other" then
-			cmdtag:add_child(content);
+			cmdreply:add_child(content);
 		end
 	end
 	local reply = st.reply(stanza);
-	reply:add_child(cmdtag);
+	reply:add_child(cmdreply);
 	origin.send(reply);
 
 	return true;