From bc2afeeef7f74a98466ba5691eb6c3a45b9665a0 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Wed, 18 Jul 2012 21:18:17 +0200 Subject: adhoc.lib: Make some globals local --- plugins/adhoc/adhoc.lib.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/adhoc/adhoc.lib.lua') diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua index eff3caff..f9510172 100644 --- a/plugins/adhoc/adhoc.lib.lua +++ b/plugins/adhoc/adhoc.lib.lua @@ -12,7 +12,7 @@ local states = {} 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 @@ function _M.handle_cmd(command, origin, stanza) 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); -- cgit v1.2.3 From e89b006f03f692a7e807c54757f0623302c40b85 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Mon, 23 Jul 2012 17:32:33 +0100 Subject: Hopefully inert commit to clean up logging across a number of modules, removing all cases of concatenation when building log messages --- plugins/adhoc/adhoc.lib.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/adhoc/adhoc.lib.lua') diff --git a/plugins/adhoc/adhoc.lib.lua b/plugins/adhoc/adhoc.lib.lua index f9510172..acdae6b9 100644 --- a/plugins/adhoc/adhoc.lib.lua +++ b/plugins/adhoc/adhoc.lib.lua @@ -65,8 +65,8 @@ function _M.handle_cmd(command, origin, stanza) if (action == "prev") or (action == "next") or (action == "complete") then actions:tag(action):up(); else - module:log("error", 'Command "'..command.name.. - '" at node "'..command.node..'" provided an invalid action "'..action..'"'); + module:log("error", "Command %q at node %q provided an invalid action %q", + command.name, command.node, action); end end cmdtag:add_child(actions); -- cgit v1.2.3