aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/mod_pubsub.lua
diff options
context:
space:
mode:
authorEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-04-15 01:21:55 +0100
committerEmmanuel Gil Peyrot <linkmauve@linkmauve.fr>2017-04-15 01:21:55 +0100
commita3dcce859a4270ae04b92881f03bb25bb766b70c (patch)
tree60d10502329cdfa165123f5cbbbfb2fc1316bf9d /plugins/mod_pubsub/mod_pubsub.lua
parent7245fe3db325f2b1bc4f88ef32ece93f0c68bc25 (diff)
downloadprosody-a3dcce859a4270ae04b92881f03bb25bb766b70c.tar.gz
prosody-a3dcce859a4270ae04b92881f03bb25bb766b70c.zip
mod_pubsub: Add item persistence using mod_storage_*’s archive store.
Diffstat (limited to 'plugins/mod_pubsub/mod_pubsub.lua')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index ae6cfce2..8bbebcf9 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -21,6 +21,8 @@ module:depends("disco");
module:add_identity("pubsub", "service", pubsub_disco_name);
module:add_feature("http://jabber.org/protocol/pubsub");
+local archive = module:open_store("pubsub", "archive");
+
function handle_pubsub_iq(event)
local origin, stanza = event.origin, event.stanza;
local pubsub_tag = stanza.tags[1];
@@ -36,6 +38,10 @@ function handle_pubsub_iq(event)
end
end
+local function simple_itemstore(config, node)
+ return lib_pubsub.simple_itemstore(archive, config, node, expose_publisher);
+end
+
function simple_broadcast(kind, node, jids, item, actor)
if item then
item = st.clone(item);
@@ -224,6 +230,7 @@ function module.load()
autocreate_on_publish = autocreate_on_publish;
autocreate_on_subscribe = autocreate_on_subscribe;
+ itemstore = simple_itemstore;
broadcaster = simple_broadcast;
get_affiliation = get_affiliation;