aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_pep.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-06-09 10:30:33 +0200
committerKim Alvefur <zash@zash.se>2016-06-09 10:30:33 +0200
commit5bbd7c9875ac3dcd65d9cabc8942438031874573 (patch)
treec78056e5d82278c7a2d031cf202d440ce06e7ad2 /plugins/mod_pep.lua
parentfac7477aad15120e671c2634fcf785fd2c135416 (diff)
downloadprosody-5bbd7c9875ac3dcd65d9cabc8942438031874573.tar.gz
prosody-5bbd7c9875ac3dcd65d9cabc8942438031874573.zip
mod_pep: Include the bare user jid in event
Diffstat (limited to 'plugins/mod_pep.lua')
-rw-r--r--plugins/mod_pep.lua5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/mod_pep.lua b/plugins/mod_pep.lua
index 896f3e78..01007a6d 100644
--- a/plugins/mod_pep.lua
+++ b/plugins/mod_pep.lua
@@ -47,11 +47,10 @@ local function subscription_presence(user_bare, recipient)
end
module:hook("pep-publish-item", function (event)
- local session, node, id, item = event.session, event.node, event.id, event.item;
+ local session, bare, node, id, item = event.session, event.user, 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
- local bare = session.username..'@'..session.host;
local stanza = st.message({from=bare, type='headline'})
:tag('event', {xmlns='http://jabber.org/protocol/pubsub#event'})
:tag('items', {node=node})
@@ -183,7 +182,7 @@ module:hook("iq/bare/http://jabber.org/protocol/pubsub:pubsub", function(event)
payload.attr.id = id;
session.send(st.reply(stanza));
module:fire_event("pep-publish-item", {
- node = node, actor = session.jid, id = id, session = session, item = st.clone(payload);
+ node = node, user = jid_bare(session.jid), actor = session.jid, id = id, session = session, item = st.clone(payload);
});
return true;
end