plugins/mod_pubsub/pubsub.lib.lua
changeset 8817 07197f29e2b8
parent 8403 518b56d806bd
child 8818 5974c9da1391
--- a/plugins/mod_pubsub/pubsub.lib.lua	Mon May 21 00:35:00 2018 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Mon May 21 00:35:45 2018 +0200
@@ -52,6 +52,14 @@
 		name = "pubsub#persist_items";
 		label = "Persist items to storage";
 	};
+	{
+		type = "list-single";
+		name = "pubsub#notification_type";
+		label = "Specify the delivery style for notifications";
+		options = {
+			{ label = "Messages of type normal", value = "normal" },
+			{ label = "Messages of type headline", value = "headline", default = true },
+		};
 };
 
 local service_method_feature_map = {
@@ -187,6 +195,7 @@
 		config = {
 			["max_items"] = tonumber(form_data["pubsub#max_items"]);
 			["persist_items"] = form_data["pubsub#persist_items"];
+			["notification_type"] = form_data["pubsub#notification_type"];
 		};
 	end
 	if node then
@@ -373,7 +382,8 @@
 	local node_config = node_obj.config;
 	local pubsub_form_data = {
 		["pubsub#max_items"] = tostring(node_config["max_items"]);
-		["pubsub#persist_items"] = node_config["persist_items"]
+		["pubsub#persist_items"] = node_config["persist_items"];
+		["pubsub#notification_type"] = node_config["notification_type"];
 	}
 	local reply = st.reply(stanza)
 		:tag("pubsub", { xmlns = xmlns_pubsub_owner })