aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/pubsub.lib.lua
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-04-14 22:45:59 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-04-14 22:45:59 +0100
commitd5e04ad835f6db036c22489a93694aabf1a3f5e2 (patch)
tree15860713d7af4ed968c34f0a43efb2585c5c0b63 /plugins/mod_pubsub/pubsub.lib.lua
parentc383c6f120b253acce68948098889ac1ccc7a910 (diff)
downloadprosody-d5e04ad835f6db036c22489a93694aabf1a3f5e2.tar.gz
prosody-d5e04ad835f6db036c22489a93694aabf1a3f5e2.zip
mod_pubsub: Fix a few warnings [luacheck]
Diffstat (limited to 'plugins/mod_pubsub/pubsub.lib.lua')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 805efc1f..fd1f59d1 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -1,3 +1,5 @@
+local t_unpack = table.unpack or unpack; -- luacheck: ignore 113
+
local st = require "util.stanza";
local uuid_generate = require "util.uuid".generate;
local dataform = require"util.dataforms".new;
@@ -23,7 +25,7 @@ local pubsub_errors = {
};
local function pubsub_error_reply(stanza, error)
local e = pubsub_errors[error];
- local reply = st.error_reply(stanza, unpack(e, 1, 3));
+ local reply = st.error_reply(stanza, t_unpack(e, 1, 3));
if e[4] then
reply:tag(e[4], { xmlns = xmlns_pubsub_errors }):up();
end
@@ -47,13 +49,13 @@ local node_config_form = dataform {
function handlers.get_items(origin, stanza, items, service)
local node = items.attr.node;
local item = items:get_child("item");
- local id = item and item.attr.id;
+ local item_id = item and item.attr.id;
if not node then
origin.send(pubsub_error_reply(stanza, "nodeid-required"));
return true;
end
- local ok, results = service:get_items(node, stanza.attr.from, id);
+ local ok, results = service:get_items(node, stanza.attr.from, item_id);
if not ok then
origin.send(pubsub_error_reply(stanza, results));
return true;
@@ -122,7 +124,7 @@ end
function handlers.set_delete(origin, stanza, delete, service)
local node = delete.attr.node;
- local reply, notifier;
+ local reply;
if not node then
origin.send(pubsub_error_reply(stanza, "nodeid-required"));
return true;