From 38ea54b37b731de1aadf0fd0a25ea060956ce878 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 1 Apr 2017 22:18:44 +0200 Subject: mod_blocklist: Use local variable [luacheck] --- plugins/mod_blocklist.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua index 6a555a06..ae24a2fc 100644 --- a/plugins/mod_blocklist.lua +++ b/plugins/mod_blocklist.lua @@ -229,7 +229,7 @@ end); -- Buggy clients module:hook("iq-error/self/blocklist-push", function (event) local origin, stanza = event.origin, event.stanza; - local _, condition, text = event.stanza:get_error(); + local _, condition, text = stanza:get_error(); local log = (origin.log or module._log); log("warn", "Client returned an error in response to notification from mod_%s: %s%s%s", module.name, condition, text and ": " or "", text or ""); -- cgit v1.2.3 From c95b62d5e25152378bd8fd7496f29ec1c5423679 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 1 Apr 2017 22:30:37 +0200 Subject: mod_disco: Rename variables to avoid name clash [luacheck] --- plugins/mod_disco.lua | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/mod_disco.lua b/plugins/mod_disco.lua index 250252c0..b135d46d 100644 --- a/plugins/mod_disco.lua +++ b/plugins/mod_disco.lua @@ -101,10 +101,10 @@ module:hook("iq/host/http://jabber.org/protocol/disco#info:query", function(even local node = stanza.tags[1].attr.node; if node and node ~= "" and node ~= "http://prosody.im#"..get_server_caps_hash() then local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info', node=node}); - local event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; - local ret = module:fire_event("host-disco-info-node", event); + local node_event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; + local ret = module:fire_event("host-disco-info-node", node_event); if ret ~= nil then return ret; end - if event.exists then + if node_event.exists then origin.send(reply); else origin.send(st.error_reply(stanza, "cancel", "item-not-found", "Node does not exist")); @@ -123,10 +123,10 @@ module:hook("iq/host/http://jabber.org/protocol/disco#items:query", function(eve local node = stanza.tags[1].attr.node; if node and node ~= "" then local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#items', node=node}); - local event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; - local ret = module:fire_event("host-disco-items-node", event); + local node_event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; + local ret = module:fire_event("host-disco-items-node", node_event); if ret ~= nil then return ret; end - if event.exists then + if node_event.exists then origin.send(reply); else origin.send(st.error_reply(stanza, "cancel", "item-not-found", "Node does not exist")); @@ -163,10 +163,10 @@ module:hook("iq/bare/http://jabber.org/protocol/disco#info:query", function(even if node and node ~= "" then local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#info', node=node}); if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account - local event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; - local ret = module:fire_event("account-disco-info-node", event); + local node_event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; + local ret = module:fire_event("account-disco-info-node", node_event); if ret ~= nil then return ret; end - if event.exists then + if node_event.exists then origin.send(reply); else origin.send(st.error_reply(stanza, "cancel", "item-not-found", "Node does not exist")); @@ -189,10 +189,10 @@ module:hook("iq/bare/http://jabber.org/protocol/disco#items:query", function(eve if node and node ~= "" then local reply = st.reply(stanza):tag('query', {xmlns='http://jabber.org/protocol/disco#items', node=node}); if not reply.attr.from then reply.attr.from = origin.username.."@"..origin.host; end -- COMPAT To satisfy Psi when querying own account - local event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; - local ret = module:fire_event("account-disco-items-node", event); + local node_event = { origin = origin, stanza = stanza, reply = reply, node = node, exists = false}; + local ret = module:fire_event("account-disco-items-node", node_event); if ret ~= nil then return ret; end - if event.exists then + if node_event.exists then origin.send(reply); else origin.send(st.error_reply(stanza, "cancel", "item-not-found", "Node does not exist")); -- cgit v1.2.3 From 3e4952567c828aa7a475fa9bcc48f794d92fdf2c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 1 Apr 2017 22:34:15 +0200 Subject: mod_saslauth: Remove unused argument [luacheck] --- plugins/mod_saslauth.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 8bbf6349..81400e45 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -82,7 +82,7 @@ local function sasl_process_cdata(session, stanza) return true; end -module:hook_tag(xmlns_sasl, "success", function (session, stanza) +module:hook_tag(xmlns_sasl, "success", function (session) if session.type ~= "s2sout_unauthed" or session.external_auth ~= "attempting" then return; end module:log("debug", "SASL EXTERNAL with %s succeeded", session.to_host); session.external_auth = "succeeded" -- cgit v1.2.3