Merge 0.11->trunk
authorKim Alvefur <zash@zash.se>
Fri, 22 Feb 2019 07:40:30 +0100
changeset 9833 fdc42f685557
parent 9830 bdc2a024933b (current diff)
parent 9832 8e68136cde08 (diff)
child 9834 d935a0f0de24
Merge 0.11->trunk
plugins/mod_pep.lua
plugins/mod_pubsub/mod_pubsub.lua
--- a/plugins/mod_pep.lua	Sat Dec 08 18:02:56 2018 +0100
+++ b/plugins/mod_pep.lua	Fri Feb 22 07:40:30 2019 +0100
@@ -9,6 +9,7 @@
 local cache = require "util.cache";
 local set = require "util.set";
 local new_id = require "util.id".medium;
+local storagemanager = require "core.storagemanager";
 
 local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
@@ -114,10 +115,11 @@
 end
 
 local function simple_itemstore(username)
+	local driver = storagemanager.get_driver(module.host, "pep_data");
 	return function (config, node)
 		if config["persist_items"] then
 			module:log("debug", "Creating new persistent item store for user %s, node %q", username, node);
-			local archive = module:open_store("pep_"..node, "archive");
+			local archive = driver:open("pep_"..node, "archive");
 			return lib_pubsub.archive_itemstore(archive, config, username, node, false);
 		else
 			module:log("debug", "Creating new ephemeral item store for user %s, node %q", username, node);
--- a/plugins/mod_pubsub/mod_pubsub.lua	Sat Dec 08 18:02:56 2018 +0100
+++ b/plugins/mod_pubsub/mod_pubsub.lua	Fri Feb 22 07:40:30 2019 +0100
@@ -3,6 +3,7 @@
 local jid_bare = require "util.jid".bare;
 local usermanager = require "core.usermanager";
 local new_id = require "util.id".medium;
+local storagemanager = require "core.storagemanager";
 
 local xmlns_pubsub = "http://jabber.org/protocol/pubsub";
 local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event";
@@ -42,7 +43,8 @@
 local node_store = module:open_store(module.name.."_nodes");
 
 local function create_simple_itemstore(node_config, node_name)
-	local archive = module:open_store("pubsub_"..node_name, "archive");
+	local driver = storagemanager.get_driver(module.host, "pubsub_data");
+	local archive = driver:open("pubsub_"..node_name, "archive");
 	return lib_pubsub.archive_itemstore(archive, node_config, nil, node_name);
 end