aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-01-21 01:29:00 +0000
committerMatthew Wild <mwild1@gmail.com>2015-01-21 01:29:00 +0000
commit6f1ffa163d7e1624892aead18a400744750f29f8 (patch)
treea2ed9fcc1c1496bdcbdf1da40e868aa4d50246fa /plugins/mod_pep.lua
parent6d2aec4a34dde4d20cc4a6f7e0a9a6db8057a630 (diff)
parente0c0cffcc27601ec9e4dd3d6fcb556baa21f1e21 (diff)
downloadprosody-6f1ffa163d7e1624892aead18a400744750f29f8.tar.gz
prosody-6f1ffa163d7e1624892aead18a400744750f29f8.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_pep.lua')
-rw-r--r--plugins/mod_pep.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 752cd28c..a6916d1f 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -41,7 +41,8 @@ local function subscription_presence(user_bare, recipient)
return is_contact_subscribed(username, host, recipient_bare);
end
-local function publish(session, node, id, item)
+module:hook("pep-publish-item", function (event)
+ local session, node, id, item = event.session, event.node, event.id, event.item;
item.attr.xmlns = nil;
local disable = #item.tags ~= 1 or #item.tags[1] == 0;
if #item.tags == 0 then item.name = "retract"; end
@@ -72,7 +73,8 @@ local function publish(session, node, id, item)
core_post_stanza(session, stanza);
end
end
-end
+end);
+
local function publish_all(user, recipient, session)
local d = data[user];
local notify = recipients[user] and recipients[user][recipient];
@@ -172,7 +174,9 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event)
local id = payload.attr.id or "1";
payload.attr.id = id;
session.send(st.reply(stanza));
- publish(session, node, id, st.clone(payload));
+ module:fire_event("pep-publish-item", {
+ node = node, actor = session.jid, id = id, session = session, item = st.clone(payload);
+ });
return true;
end
end