aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/pubsub.lib.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-07-06 16:04:53 +0200
committerKim Alvefur <zash@zash.se>2018-07-06 16:04:53 +0200
commit8186130fdeb93daf8975847dd6b37030a1311cd1 (patch)
tree22b35973929c41ef7f32238985647778a762b397 /plugins/mod_pubsub/pubsub.lib.lua
parente3e2cb7f30fb135680d5d951b2244ce7707273a3 (diff)
downloadprosody-8186130fdeb93daf8975847dd6b37030a1311cd1.tar.gz
prosody-8186130fdeb93daf8975847dd6b37030a1311cd1.zip
mod_pubsub: Support configurable title and description fields
Diffstat (limited to 'plugins/mod_pubsub/pubsub.lib.lua')
-rw-r--r--plugins/mod_pubsub/pubsub.lib.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/mod_pubsub/pubsub.lib.lua b/plugins/mod_pubsub/pubsub.lib.lua
index aa8eb32a..0aedda1a 100644
--- a/plugins/mod_pubsub/pubsub.lib.lua
+++ b/plugins/mod_pubsub/pubsub.lib.lua
@@ -46,6 +46,16 @@ local node_config_form = dataform {
};
{
type = "text-single";
+ name = "pubsub#title";
+ label = "Title";
+ };
+ {
+ type = "text-single";
+ name = "pubsub#description";
+ label = "Description";
+ };
+ {
+ type = "text-single";
name = "pubsub#max_items";
label = "Max # of items to persist";
};
@@ -399,6 +409,8 @@ function handlers.owner_get_configure(origin, stanza, config, service)
local node_config = node_obj.config;
local pubsub_form_data = {
+ ["pubsub#title"] = node_config["title"];
+ ["pubsub#description"] = node_config["description"];
["pubsub#max_items"] = tostring(node_config["max_items"]);
["pubsub#persist_items"] = node_config["persist_items"];
["pubsub#notification_type"] = node_config["notification_type"];
@@ -433,6 +445,8 @@ function handlers.owner_set_configure(origin, stanza, config, service)
return true;
end
local new_config = {
+ ["title"] = form_data["pubsub#title"];
+ ["description"] = form_data["pubsub#description"];
["max_items"] = tonumber(form_data["pubsub#max_items"]);
["persist_items"] = form_data["pubsub#persist_items"];
["notification_type"] = form_data["pubsub#notification_type"];