aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-09-28 01:55:32 +0200
committerKim Alvefur <zash@zash.se>2014-09-28 01:55:32 +0200
commit55bacaf74f778f267bcf1f01c5c11caaa31ac671 (patch)
treeabf1f53031007cd82fde221fcf717e746efe290a
parente157a9d6ee57e31d42dfe72afcca6d43e6506cab (diff)
downloadprosody-55bacaf74f778f267bcf1f01c5c11caaa31ac671.tar.gz
prosody-55bacaf74f778f267bcf1f01c5c11caaa31ac671.zip
mod_pubsub: Add support for requesting default node configuration
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua1
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua8
2 files changed, 9 insertions, 0 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 1364bd27..0ffa7981 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -65,6 +65,7 @@ local feature_map = {
add_subscription = { "subscribe" };
get_subscriptions = { "retrieve-subscriptions" };
set_configure = { "config-node" };
+ get_default = { "retrieve-default" };
};
local function add_disco_features_from_service(service)
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index 075182a2..8a22fa69 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -271,4 +271,12 @@ function handlers.set_configure(origin, stanza, config, service)
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;