Comparison

plugins/mod_pubsub/mod_pubsub.lua @ 8957:21ae6cb20dcf

mod_pubsub: Remove feature flag for data persistence since node config is now persistent
author Kim Alvefur <zash@zash.se>
date Sun, 01 Jul 2018 04:46:39 +0200
parent 8946:3a095233e178
child 8980:4d2738b99b07
comparison
equal deleted inserted replaced
8956:82f92af4b0f3 8957:21ae6cb20dcf
11 local autocreate_on_publish = module:get_option_boolean("autocreate_on_publish", false); 11 local autocreate_on_publish = module:get_option_boolean("autocreate_on_publish", false);
12 local autocreate_on_subscribe = module:get_option_boolean("autocreate_on_subscribe", false); 12 local autocreate_on_subscribe = module:get_option_boolean("autocreate_on_subscribe", false);
13 local pubsub_disco_name = module:get_option_string("name", "Prosody PubSub Service"); 13 local pubsub_disco_name = module:get_option_string("name", "Prosody PubSub Service");
14 local expose_publisher = module:get_option_boolean("expose_publisher", false) 14 local expose_publisher = module:get_option_boolean("expose_publisher", false)
15 15
16 local enable_persistence = module:get_option_boolean("experimental_pubsub_item_persistence", false);
17
18 local service; 16 local service;
19 17
20 local lib_pubsub = module:require "pubsub"; 18 local lib_pubsub = module:require "pubsub";
21 19
22 module:depends("disco"); 20 module:depends("disco");
31 29
32 local function create_simple_itemstore(node_config, node_name) 30 local function create_simple_itemstore(node_config, node_name)
33 local archive = module:open_store("pubsub_"..node_name, "archive"); 31 local archive = module:open_store("pubsub_"..node_name, "archive");
34 return lib_pubsub.archive_itemstore(archive, node_config, nil, node_name); 32 return lib_pubsub.archive_itemstore(archive, node_config, nil, node_name);
35 end 33 end
36
37 if enable_persistence then
38 module:log("warn", "Item persistence is an experimental feature. Note that ownership information is lost on restart.")
39 else
40 create_simple_itemstore = nil;
41 end
42
43 34
44 function simple_broadcast(kind, node, jids, item, actor, node_obj) 35 function simple_broadcast(kind, node, jids, item, actor, node_obj)
45 if item then 36 if item then
46 item = st.clone(item); 37 item = st.clone(item);
47 item.attr.xmlns = nil; -- Clear the pubsub namespace 38 item.attr.xmlns = nil; -- Clear the pubsub namespace