Diff

plugins/mod_pubsub/pubsub.lib.lua @ 9096:7de4eec02ece

mod_pubsub: Add access model to configuration form
author Kim Alvefur <zash@zash.se>
date Sat, 04 Aug 2018 03:38:38 +0200
parent 9076:00d89430d77e
child 9102:f3a1ecc46f20
line wrap: on
line diff
--- a/plugins/mod_pubsub/pubsub.lib.lua	Sat Aug 04 03:38:20 2018 +0200
+++ b/plugins/mod_pubsub/pubsub.lib.lua	Sat Aug 04 03:38:38 2018 +0200
@@ -48,6 +48,7 @@
 		["pubsub#max_items"] = tostring(node_config["max_items"]);
 		["pubsub#persist_items"] = node_config["persist_items"];
 		["pubsub#notification_type"] = node_config["notification_type"];
+		["pubsub#access_model"] = node_config["access_model"];
 	}
 end
 
@@ -58,6 +59,7 @@
 		["max_items"] = tonumber(config["pubsub#max_items"]);
 		["persist_items"] = config["pubsub#persist_items"];
 		["notification_type"] = config["pubsub#notification_type"];
+		["access_model"] = config["pubsub#access_model"];
 	}
 end
 
@@ -89,6 +91,18 @@
 	};
 	{
 		type = "list-single";
+		name = "pubsub#access_model";
+		label = "Specify the subscriber model";
+		options = {
+			{ value = "authorize" },
+			{ value = "open" },
+			{ value = "presence" },
+			{ value = "roster" },
+			{ value = "whitelist" },
+		};
+	};
+	{
+		type = "list-single";
 		name = "pubsub#notification_type";
 		label = "Specify the delivery style for notifications";
 		options = {