Changeset

2952:e8462d6dbc6d

mod_component_http: Fix some [luacheck] warnings
author Matthew Wild <mwild1@gmail.com>
date Mon, 26 Mar 2018 13:56:18 +0100
parents 2951:01ed9eb111d4
children 2953:0092bcceda0a
files mod_component_http/mod_component_http.lua
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mod_component_http/mod_component_http.lua	Mon Mar 26 13:52:38 2018 +0100
+++ b/mod_component_http/mod_component_http.lua	Mon Mar 26 13:56:18 2018 +0100
@@ -42,8 +42,8 @@
 	});
 	http.request(url, {
 		body = request_body;
-	}, function (response_text, code, req, response)
-		if stanza.attr.type == "error" then return; end -- Avoid error loops, don't reply to error stanzas		
+	}, function (response_text, code, _, response)
+		if stanza.attr.type == "error" then return; end -- Avoid error loops, don't reply to error stanzas
 		if code == 200 and response_text and response.headers["content-type"] == "application/json" then
 			local response_data = json.decode(response_text);
 			if response_data.stanza then
@@ -86,7 +86,7 @@
 
 -- Simple handler for an always-online JID that allows everyone to subscribe to presence
 local function default_presence_handler(event)
-	local origin, stanza = event.origin, event.stanza;
+	local stanza = event.stanza;
 	module:log("debug", "Handling %s", tostring(stanza));
 	if stanza.attr.type == "probe" then
 		module:send(st.presence({ to = stanza.attr.from, from = stanza.attr.to.."/default" }));
@@ -94,7 +94,7 @@
 		module:send(st.presence({ type = "subscribed", to = stanza.attr.from, from = stanza.attr.to.."/default" }));
 		module:send(st.presence({ to = stanza.attr.from, from = stanza.attr.to.."/default" }));
 	elseif stanza.attr.type == "unsubscribe" then
-		module:send(st.presence({ type = "unavailable", to = stanza.attr.from, from = stanza.attr.to.."/default" }));	
+		module:send(st.presence({ type = "unavailable", to = stanza.attr.from, from = stanza.attr.to.."/default" }));
 	end
 	return true;
 end