From 158ea2ce458caa15881087bcab6809ef91cb54c9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sat, 27 Sep 2014 19:53:39 +0200 Subject: mod_pubsub: Transplant pieces of cdcfd93e2f43 from trunk --- plugins/mod_pubsub/mod_pubsub.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugins/mod_pubsub/mod_pubsub.lua') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index c6dbe831..33e729af 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -100,7 +100,7 @@ module:hook("host-disco-items-node", function (event) return; end - for id, item in pairs(ret) do + for _, id in ipairs(ret) do reply:tag("item", { jid = module.host, name = id }):up(); end event.exists = true; -- cgit v1.2.3 From 952a9b8b8500d67a37c983b93a0c3f00a3e38e95 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Sep 2014 01:46:17 +0200 Subject: mod_pubsub: Add support for node configuration --- plugins/mod_pubsub/mod_pubsub.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'plugins/mod_pubsub/mod_pubsub.lua') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index 33e729af..1107061e 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -64,6 +64,7 @@ local feature_map = { get_items = { "retrieve-items" }; add_subscription = { "subscribe" }; get_subscriptions = { "retrieve-subscriptions" }; + set_configure = { "config-node" }; }; local function add_disco_features_from_service(service) @@ -195,6 +196,7 @@ function module.load() retract = true; delete = true; get_nodes = true; + configure = true; subscribe = true; unsubscribe = true; @@ -215,6 +217,14 @@ function module.load() }; }; + node_config_form = require"util.dataforms".new { + { + type = "hidden"; + name = "FORM_TYPE"; + value = "http://jabber.org/protocol/pubsub#node_config"; + }; + }; + autocreate_on_publish = autocreate_on_publish; autocreate_on_subscribe = autocreate_on_subscribe; -- cgit v1.2.3 From e157a9d6ee57e31d42dfe72afcca6d43e6506cab Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Sep 2014 01:50:17 +0200 Subject: mod_pubsub: Add max items to node config form --- plugins/mod_pubsub/mod_pubsub.lua | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plugins/mod_pubsub/mod_pubsub.lua') diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index 1107061e..1364bd27 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -223,6 +223,11 @@ function module.load() name = "FORM_TYPE"; value = "http://jabber.org/protocol/pubsub#node_config"; }; + { + type = "text-single"; + name = "pubsub#max_items"; + label = "Max # of items to persist"; + }; }; autocreate_on_publish = autocreate_on_publish; -- cgit v1.2.3 From 55bacaf74f778f267bcf1f01c5c11caaa31ac671 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Sep 2014 01:55:32 +0200 Subject: mod_pubsub: Add support for requesting default node configuration --- plugins/mod_pubsub/mod_pubsub.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins/mod_pubsub/mod_pubsub.lua') 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) -- cgit v1.2.3