aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-07-29 17:57:24 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-07-29 17:57:24 +0500
commite55c192465fb55cdaee01cb91e2f0e274778c5e6 (patch)
tree44560164f256d40f91a1855a2f024ce278b687c6
parent8ad65c2824d2ee3bd52175df34fdd7bd9d393231 (diff)
downloadprosody-e55c192465fb55cdaee01cb91e2f0e274778c5e6.tar.gz
prosody-e55c192465fb55cdaee01cb91e2f0e274778c5e6.zip
mod_pep: Added support for pubsub item retraction
-rw-r--r--plugins/mod_pep.lua3
1 files changed, 2 insertions, 1 deletions
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 -- <pubsub xmlns='http://jabber.org/protocol/pubsub'>
payload = payload.tags[1];
- if payload and payload.name == 'publish' and payload.attr.node then -- <publish node='http://jabber.org/protocol/tune'>
+ if payload and (payload.name == 'publish' or payload.name == 'retract') and payload.attr.node then -- <publish node='http://jabber.org/protocol/tune'>
local node = payload.attr.node;
payload = payload.tags[1];
if payload then -- <item>