Changeset

8214:da8bc600902a

mod_pep_plus: Fix all of the warnings [luacheck]
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 15 Apr 2017 01:26:19 +0100
parents 8213:e1272aeef31c
children 8215:835bb32c36b4
files plugins/mod_pep_plus.lua
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pep_plus.lua	Sat Apr 15 01:21:55 2017 +0100
+++ b/plugins/mod_pep_plus.lua	Sat Apr 15 01:26:19 2017 +0100
@@ -12,7 +12,6 @@
 
 local lib_pubsub = module:require "pubsub";
 local handlers = lib_pubsub.handlers;
-local pubsub_error_reply = lib_pubsub.pubsub_error_reply;
 
 local empty_set = set_new();
 
@@ -179,8 +178,8 @@
 
 function handle_pubsub_iq(event)
 	local origin, stanza = event.origin, event.stanza;
-	local pubsub = stanza.tags[1];
-	local action = pubsub.tags[1];
+	local pubsub_tag = stanza.tags[1];
+	local action = pubsub_tag.tags[1];
 	if not action then
 		return origin.send(st.error_reply(stanza, "cancel", "bad-request"));
 	end
@@ -225,7 +224,7 @@
 local function resend_last_item(jid, node, service)
 	local ok, items = service:get_items(node, jid);
 	if not ok then return; end
-	for i, id in ipairs(items) do
+	for _, id in ipairs(items) do
 		service.config.broadcaster("items", node, { [jid] = true }, items[id]);
 	end
 end
@@ -271,7 +270,6 @@
 	local user = stanza.attr.to or (origin.username..'@'..origin.host);
 	local t = stanza.attr.type;
 	local self = not stanza.attr.to;
-	local service = get_pep_service(user);
 
 	if not t then -- available presence
 		if self or subscription_presence(user, stanza.attr.from) then