Comparison

plugins/mod_pubsub/mod_pubsub.lua @ 9828:8e68136cde08 0.11

mod_pubsub: Simplify configuration for node data (see #1302)
author Kim Alvefur <zash@zash.se>
date Fri, 22 Feb 2019 07:33:23 +0100
parent 9597:17d43543f9b6
child 9829:fdc42f685557
child 10672:657e61531b33
comparison
equal deleted inserted replaced
9827:fd8aaab6669c 9828:8e68136cde08
1 local pubsub = require "util.pubsub"; 1 local pubsub = require "util.pubsub";
2 local st = require "util.stanza"; 2 local st = require "util.stanza";
3 local jid_bare = require "util.jid".bare; 3 local jid_bare = require "util.jid".bare;
4 local usermanager = require "core.usermanager"; 4 local usermanager = require "core.usermanager";
5 local new_id = require "util.id".medium; 5 local new_id = require "util.id".medium;
6 local storagemanager = require "core.storagemanager";
6 7
7 local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; 8 local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
8 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event"; 9 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
9 local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner"; 10 local xmlns_pubsub_owner = "http://jabber.org/protocol/pubsub#owner";
10 11
40 41
41 42
42 local node_store = module:open_store(module.name.."_nodes"); 43 local node_store = module:open_store(module.name.."_nodes");
43 44
44 local function create_simple_itemstore(node_config, node_name) 45 local function create_simple_itemstore(node_config, node_name)
45 local archive = module:open_store("pubsub_"..node_name, "archive"); 46 local driver = storagemanager.get_driver(module.host, "pubsub_data");
47 local archive = driver:open("pubsub_"..node_name, "archive");
46 return lib_pubsub.archive_itemstore(archive, node_config, nil, node_name); 48 return lib_pubsub.archive_itemstore(archive, node_config, nil, node_name);
47 end 49 end
48 50
49 function simple_broadcast(kind, node, jids, item, actor, node_obj) 51 function simple_broadcast(kind, node, jids, item, actor, node_obj)
50 if node_obj then 52 if node_obj then