aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pubsub/mod_pubsub.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_pubsub/mod_pubsub.lua')
-rw-r--r--plugins/mod_pubsub/mod_pubsub.lua26
1 files changed, 19 insertions, 7 deletions
diff --git a/plugins/mod_pubsub/mod_pubsub.lua b/plugins/mod_pubsub/mod_pubsub.lua
index 8e7bfc53..d4733ee4 100644
--- a/plugins/mod_pubsub/mod_pubsub.lua
+++ b/plugins/mod_pubsub/mod_pubsub.lua
@@ -16,16 +16,19 @@ local service;
local lib_pubsub = module:require "pubsub";
local handlers = lib_pubsub.handlers;
-local pubsub_error_reply = lib_pubsub.pubsub_error_reply;
module:depends("disco");
module:add_identity("pubsub", "service", pubsub_disco_name);
module:add_feature("http://jabber.org/protocol/pubsub");
+--[[ TODO Disabled until config persistence is implemented
+local archive = module:open_store("pubsub", "archive");
+--]]
+
function handle_pubsub_iq(event)
local origin, stanza = event.origin, event.stanza;
- local pubsub = stanza.tags[1];
- local action = pubsub.tags[1];
+ local pubsub_tag = stanza.tags[1];
+ local action = pubsub_tag.tags[1];
if not action then
origin.send(st.error_reply(stanza, "cancel", "bad-request"));
return true;
@@ -37,6 +40,12 @@ function handle_pubsub_iq(event)
end
end
+--[[ TODO Disabled until config persistence is implemented
+local function simple_itemstore(config, node)
+ return lib_pubsub.simple_itemstore(archive, config, nil, node, expose_publisher);
+end
+--]]
+
function simple_broadcast(kind, node, jids, item, actor)
if item then
item = st.clone(item);
@@ -90,7 +99,7 @@ local function add_disco_features_from_service(service)
end
module:hook("host-disco-info-node", function (event)
- local stanza, origin, reply, node = event.stanza, event.origin, event.reply, event.node;
+ local stanza, reply, node = event.stanza, event.reply, event.node;
local ok, ret = service:get_nodes(stanza.attr.from);
if not ok or not ret[node] then
return;
@@ -100,7 +109,7 @@ module:hook("host-disco-info-node", function (event)
end);
module:hook("host-disco-items-node", function (event)
- local stanza, origin, reply, node = event.stanza, event.origin, event.reply, event.node;
+ local stanza, reply, node = event.stanza, event.reply, event.node;
local ok, ret = service:get_items(node, stanza.attr.from);
if not ok then
return;
@@ -114,8 +123,8 @@ end);
module:hook("host-disco-items", function (event)
- local stanza, origin, reply = event.stanza, event.origin, event.reply;
- local ok, ret = service:get_nodes(event.stanza.attr.from);
+ local stanza, reply = event.stanza, event.reply;
+ local ok, ret = service:get_nodes(stanza.attr.from);
if not ok then
return;
end
@@ -225,6 +234,9 @@ function module.load()
autocreate_on_publish = autocreate_on_publish;
autocreate_on_subscribe = autocreate_on_subscribe;
+ --[[ TODO Disabled until config persistence is implemented
+ itemstore = simple_itemstore;
+ --]]
broadcaster = simple_broadcast;
get_affiliation = get_affiliation;