Diff

plugins/adhoc/adhoc.lib.lua @ 4975:6f689c155186

adhoc.lib: Make some globals local
author Kim Alvefur <zash@zash.se>
date Wed, 18 Jul 2012 21:18:17 +0200
parent 4860:b66e73793cb7
child 4993:5243b74a4cbb
line wrap: on
line diff
--- a/plugins/adhoc/adhoc.lib.lua	Mon Jul 09 20:39:55 2012 +0200
+++ b/plugins/adhoc/adhoc.lib.lua	Wed Jul 18 21:18:17 2012 +0200
@@ -12,7 +12,7 @@
 
 local _M = {};
 
-function _cmdtag(desc, status, sessionid, action)
+local function _cmdtag(desc, status, sessionid, action)
 	local cmd = st.stanza("command", { xmlns = xmlns_cmd, node = desc.node, status = status });
 	if sessionid then cmd.attr.sessionid = sessionid; end
 	if action then cmd.attr.action = action; end
@@ -35,6 +35,7 @@
 	local data, state = command:handler(dataIn, states[sessionid]);
 	states[sessionid] = state;
 	local stanza = st.reply(stanza);
+	local cmdtag;
 	if data.status == "completed" then
 		states[sessionid] = nil;
 		cmdtag = command:cmdtag("completed", sessionid);