# HG changeset patch
# User Matthew Wild <mwild1@gmail.com>
# Date 1642255579 0
# Node ID 57311c54501308337ba27b51cdc93e1e186ee8e7
# Parent  9d29467f4d5b7dac64206ad00b88513601bfc29f
mod_http_xep227: Fix validation of resulting export XML

diff -r 9d29467f4d5b -r 57311c545013 mod_http_xep227/mod_http_xep227.lua
--- a/mod_http_xep227/mod_http_xep227.lua	Sat Jan 15 13:46:34 2022 +0000
+++ b/mod_http_xep227/mod_http_xep227.lua	Sat Jan 15 14:06:19 2022 +0000
@@ -132,13 +132,15 @@
 		end
 	end
 
-	if not user_xml or not user_xml:find("host/user") then
-		module:log("warn", "No data to export: %s", tostring(user_xml));
+	local xml_data = user_xml:get_user_xml(username, session.host);
+
+	if not xml_data or not xml_data:find("host/user") then
+		module:log("warn", "No data to export: %s", tostring(xml_data));
 		return 204;
 	end
 
 	event.response.headers["Content-Type"] = "application/xml";
-	return [[<?xml version="1.0" encoding="utf-8" ?>]]..tostring(user_xml);
+	return [[<?xml version="1.0" encoding="utf-8" ?>]]..tostring(xml_data);
 end
 
 local function is_looking_like_xep227(xml_data)