From e0e83371bfd75c92db4dc8cb82f5572eae42cc85 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 6 Jul 2018 16:04:53 +0200 Subject: mod_pubsub: Support configurable title and description fields --- plugins/mod_pubsub/pubsub.lib.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'plugins') 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 @@ -44,6 +44,16 @@ local node_config_form = dataform { name = "FORM_TYPE"; value = "http://jabber.org/protocol/pubsub#node_config"; }; + { + type = "text-single"; + name = "pubsub#title"; + label = "Title"; + }; + { + type = "text-single"; + name = "pubsub#description"; + label = "Description"; + }; { type = "text-single"; name = "pubsub#max_items"; @@ -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"]; -- cgit v1.2.3