Changeset

8313:21466b778bf1

mod_pubsub: Hide item persistence behind option (at least until affiliations are also persisted)
author Kim Alvefur <zash@zash.se>
date Mon, 09 Oct 2017 02:08:41 +0200
parents 8312:6fd36e73082b
children 8314:1d2149d84c72
files plugins/mod_pubsub/mod_pubsub.lua
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_pubsub/mod_pubsub.lua	Mon Oct 09 01:57:55 2017 +0200
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Mon Oct 09 02:08:41 2017 +0200
@@ -12,6 +12,8 @@
 local pubsub_disco_name = module:get_option_string("name", "Prosody PubSub Service");
 local expose_publisher = module:get_option_boolean("expose_publisher", false)
 
+local enable_persistence = module:get_option_boolean("experimental_pubsub_item_persistence", false);
+
 local service;
 
 local lib_pubsub = module:require "pubsub";
@@ -41,6 +43,13 @@
 	return lib_pubsub.simple_itemstore(archive, config, nil, node, expose_publisher);
 end
 
+if enable_persistence then
+	module:log("warn", "Item persistence is an experimental feature. Note that ownership information is lost on restart.")
+else
+	simple_itemstore = nil;
+end
+
+
 function simple_broadcast(kind, node, jids, item, actor)
 	if item then
 		item = st.clone(item);