Diff

plugins/mod_component.lua @ 7301:995777582044

mod_component: Some cleanup [luacheck]
author Matthew Wild <mwild1@gmail.com>
date Fri, 18 Mar 2016 14:03:14 +0000
parent 7300:66e7517bd8f3
child 7359:a5a080c12c96
child 7665:2e553f80aedd
line wrap: on
line diff
--- a/plugins/mod_component.lua	Fri Mar 18 13:58:55 2016 +0000
+++ b/plugins/mod_component.lua	Fri Mar 18 14:03:14 2016 +0000
@@ -40,7 +40,7 @@
 
 	local send;
 
-	local function on_destroy(session, err)
+	local function on_destroy(session, err) --luacheck: ignore 212/err
 		env.connected = false;
 		env.session = false;
 		send = nil;
@@ -149,7 +149,7 @@
 
 local xmlns_xmpp_streams = "urn:ietf:params:xml:ns:xmpp-streams";
 
-function stream_callbacks.error(session, error, data, data2)
+function stream_callbacks.error(session, error, data)
 	if session.destroyed then return; end
 	module:log("warn", "Error processing component stream: %s", tostring(error));
 	if error == "no-stream" then
@@ -295,7 +295,7 @@
 		session.stream:reset();
 	end
 
-	function session.data(conn, data)
+	function session.data(_, data)
 		local ok, err = stream:feed(data);
 		if ok then return; end
 		module:log("debug", "Received invalid XML (%s) %d bytes: %s", tostring(err), #data, data:sub(1, 300):gsub("[\r\n]+", " "):gsub("[%z\1-\31]", "_"));
@@ -323,7 +323,6 @@
 			end
 		end
 		session.destroyed = true;
-		session = nil;
 	end
 end