mod_http_xep227: Fix luacheck warnings
authorMatthew Wild <mwild1@gmail.com>
Sat, 15 Jan 2022 13:46:34 +0000
changeset 4871 9d29467f4d5b
parent 4870 a1181413a0eb
child 4872 57311c545013
mod_http_xep227: Fix luacheck warnings
mod_http_xep227/mod_http_xep227.lua
--- a/mod_http_xep227/mod_http_xep227.lua	Sat Jan 15 00:38:32 2022 +0100
+++ b/mod_http_xep227/mod_http_xep227.lua	Sat Jan 15 13:46:34 2022 +0000
@@ -72,7 +72,7 @@
 		store_name = "pep_data";
 	end
 	-- Return driver
-	return sm.get_driver(session.host, driver_store_name);
+	return sm.get_driver(host, store_name);
 end
 
 local function handle_export_227(event)
@@ -147,7 +147,7 @@
 		return false;
 	end
 	-- Looks like 227, but check it has at least one host + user element
-	return not not input_xml_parsed:find("host/user");
+	return not not xml_data:find("host/user");
 end
 
 local function handle_import_227(event)
@@ -158,7 +158,7 @@
 	local input_xml_parsed = xml.parse(input_xml_raw);
 
 	-- Some sanity checks
-	if not input_xml_parsed or not is_looking_like_227(input_xml_parsed) then
+	if not input_xml_parsed or not is_looking_like_xep227(input_xml_parsed) then
 		module:log("warn", "No data to import");
 		return 422;
 	end