aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep_plus.lua
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-04-15 09:35:33 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-04-15 09:35:33 +0100
commite22bd6c0ef728c5e72f340c4ebb2e31f3986fd43 (patch)
tree468b6fc19317f65b3173df7947c64465b3d201ea /plugins/mod_pep_plus.lua
parent33e5314de0d492f866fb7e208260ca0801170a93 (diff)
downloadprosody-e22bd6c0ef728c5e72f340c4ebb2e31f3986fd43.tar.gz
prosody-e22bd6c0ef728c5e72f340c4ebb2e31f3986fd43.zip
mod_pep_plus: Add item persistency.
Diffstat (limited to 'plugins/mod_pep_plus.lua')
-rw-r--r--plugins/mod_pep_plus.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_pep_plus.lua b/plugins/mod_pep_plus.lua
index 3b230969..49def4e3 100644
--- a/plugins/mod_pep_plus.lua
+++ b/plugins/mod_pep_plus.lua
@@ -19,6 +19,8 @@ local services = {};
local recipients = {};
local hash_map = {};
+local archive = module:open_store("pubsub", "archive");
+
function module.save()
return { services = services };
end
@@ -34,6 +36,10 @@ local function subscription_presence(user_bare, recipient)
return is_contact_subscribed(username, host, recipient_bare);
end
+local function simple_itemstore(config, node)
+ return lib_pubsub.simple_itemstore(archive, config, node, false);
+end
+
local function get_broadcaster(name)
local function simple_broadcast(kind, node, jids, item)
if item then
@@ -160,6 +166,7 @@ function get_pep_service(name)
autocreate_on_publish = true;
autocreate_on_subscribe = true;
+ itemstore = simple_itemstore;
broadcaster = get_broadcaster(name);
get_affiliation = function (jid)
if jid_bare(jid) == name then