Comparison

plugins/mod_pubsub/mod_pubsub.lua @ 8504:80b8355c8b8b

mod_pubsub: Add nodestore to service configuration
author Matthew Wild <mwild1@gmail.com>
date Fri, 02 Feb 2018 19:46:33 +0000
parent 8503:3b86134c56ea
child 8505:c9bdb4dfed96
comparison
equal deleted inserted replaced
8503:3b86134c56ea 8504:80b8355c8b8b
23 module:add_feature("http://jabber.org/protocol/pubsub"); 23 module:add_feature("http://jabber.org/protocol/pubsub");
24 24
25 function handle_pubsub_iq(event) 25 function handle_pubsub_iq(event)
26 return lib_pubsub.handle_pubsub_iq(event, service); 26 return lib_pubsub.handle_pubsub_iq(event, service);
27 end 27 end
28
29 local node_store = module:open_store(module.name.."_nodes");
28 30
29 local function create_simple_itemstore(node_config, node_name) 31 local function create_simple_itemstore(node_config, node_name)
30 local archive = module:open_store("pubsub_"..node_name, "archive"); 32 local archive = module:open_store("pubsub_"..node_name, "archive");
31 return lib_pubsub.archive_itemstore(archive, node_config, nil, node_name); 33 return lib_pubsub.archive_itemstore(archive, node_config, nil, node_name);
32 end 34 end
200 }; 202 };
201 203
202 autocreate_on_publish = autocreate_on_publish; 204 autocreate_on_publish = autocreate_on_publish;
203 autocreate_on_subscribe = autocreate_on_subscribe; 205 autocreate_on_subscribe = autocreate_on_subscribe;
204 206
207 nodestore = node_store;
205 itemstore = create_simple_itemstore; 208 itemstore = create_simple_itemstore;
206 broadcaster = simple_broadcast; 209 broadcaster = simple_broadcast;
207 get_affiliation = get_affiliation; 210 get_affiliation = get_affiliation;
208 211
209 normalize_jid = jid_bare; 212 normalize_jid = jid_bare;