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
commitcd0dd3f92b02d855c98701792c179d02ad12bf24 (patch)
treea2ed9fcc1c1496bdcbdf1da40e868aa4d50246fa /plugins/mod_pep.lua
parent6591bd9db584bf6c5b8920c4438cd087bbfefce3 (diff)
parent5723bad906dcbef98eb1cdc196675a7a526f97cc (diff)
downloadprosody-cd0dd3f92b02d855c98701792c179d02ad12bf24.tar.gz
prosody-cd0dd3f92b02d855c98701792c179d02ad12bf24.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