From e55c192465fb55cdaee01cb91e2f0e274778c5e6 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 29 Jul 2009 17:57:24 +0500 Subject: mod_pep: Added support for pubsub item retraction --- plugins/mod_pep.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua index 8cc4aedf..768d4a4a 100644 --- a/plugins/mod_pep.lua +++ b/plugins/mod_pep.lua @@ -30,6 +30,7 @@ module:add_feature("http://jabber.org/protocol/pubsub#publish"); local function publish(session, node, item) local disable = #item.tags ~= 1 or #item.tags[1].tags == 0; + if #item.tags == 0 then item.name = "retract"; end local bare = session.username..'@'..session.host; local stanza = st.message({from=bare, type='headline'}) :tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'}) @@ -128,7 +129,7 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event) local payload = stanza.tags[1]; if payload.name == 'pubsub' then -- payload = payload.tags[1]; - if payload and payload.name == 'publish' and payload.attr.node then -- + if payload and (payload.name == 'publish' or payload.name == 'retract') and payload.attr.node then -- local node = payload.attr.node; payload = payload.tags[1]; if payload then -- -- cgit v1.2.3