mod_http_xep227/mod_http_xep227.lua
changeset 4873 c3bf568e3977
parent 4872 57311c545013
child 4874 d8a0a8dcdc0d
--- a/mod_http_xep227/mod_http_xep227.lua	Sat Jan 15 14:06:19 2022 +0000
+++ b/mod_http_xep227/mod_http_xep227.lua	Sat Jan 15 14:25:27 2022 +0000
@@ -1,6 +1,7 @@
 local it = require "util.iterators";
 local http = require "util.http";
 local sm = require "core.storagemanager";
+local st = require "util.stanza";
 local xml = require "util.xml";
 
 local tokens = module:depends("tokenauth");
@@ -20,7 +21,9 @@
 };
 
 local function new_user_xml(username, host)
-	local user_xml;
+	local user_xml = st.stanza("server-data", {xmlns='urn:xmpp:pie:0'})
+		:tag("host", { jid = host })
+			:tag("user", { name = username }):reset();
 
 	return {
 		set_user_xml = function (_, store_username, store_host, new_xml)