Diff

plugins/mod_pubsub/pubsub.lib.lua @ 6441:bcb1ea9047d3

mod_pubsub: Add support for requesting default node configuration
author Kim Alvefur <zash@zash.se>
date Sun, 28 Sep 2014 01:55:32 +0200
parent 6438:b1c40054b59d
child 6445:f1ad3923368c
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua	Sun Sep 28 01:50:17 2014 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Sun Sep 28 01:55:32 2014 +0200
@@ -271,4 +271,12 @@
 	return origin.send(st.reply(stanza));
 end
 
+function handlers.get_default(origin, stanza, default, service)
+	local reply = st.reply(stanza)
+		:tag("pubsub", { xmlns = xmlns_pubsub_owner })
+			:tag("configure", { node = node })
+				:add_child(form:form(service.node_default_config));
+	return origin.send(reply);
+end
+
 return _M;