From e289d31177f302130c415e858419a33a6ceb62ab Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 22 Feb 2019 07:35:44 +0100 Subject: mod_pep: Simplify configuration for node data (fixes #1320) --- plugins/mod_pep.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 1d8c55bf..7a4aac2b 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -8,6 +8,7 @@ local calculate_hash = require "util.caps".calculate_hash; local is_contact_subscribed = require "core.rostermanager".is_contact_subscribed; local cache = require "util.cache"; local set = require "util.set"; +local storagemanager = require "core.storagemanager"; local xmlns_pubsub = "http://jabber.org/protocol/pubsub"; local xmlns_pubsub_event = "http://jabber.org/protocol/pubsub#event"; @@ -113,10 +114,11 @@ local function nodestore(username) 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); -- cgit v1.2.3 From 4673e4897ba9f18cc450c94a32798d3c4345d714 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 22 Feb 2019 07:33:23 +0100 Subject: mod_pubsub: Simplify configuration for node data (see #1302) --- plugins/mod_pubsub/mod_pubsub.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua index 40adcafe..855c5fd2 100644 --- a/plugins/mod_pubsub/mod_pubsub.lua +++ b/plugins/mod_pubsub/mod_pubsub.lua @@ -3,6 +3,7 @@ local st = require "util.stanza"; 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 @@ end 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 -- cgit v1.2.3