# HG changeset patch # User Kim Alvefur # Date 1465461033 -7200 # Node ID b1efeee55972d688f5d092c49a32af6ced0d2149 # Parent 6943b1dd4e3d1c60de576923ccdc1490044c5ede mod_pep: Include the bare user jid in event diff -r 6943b1dd4e3d -r b1efeee55972 plugins/mod_pep.lua --- a/plugins/mod_pep.lua Mon May 30 13:30:32 2016 +0200 +++ b/plugins/mod_pep.lua Thu Jun 09 10:30:33 2016 +0200 @@ -47,11 +47,10 @@ 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 @@ 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