projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
59ded0b
)
mod_pep: Include the bare user jid in event
author
Kim Alvefur
<zash@zash.se>
Thu, 9 Jun 2016 08:30:33 +0000
(10:30 +0200)
committer
Kim Alvefur
<zash@zash.se>
Thu, 9 Jun 2016 08:30:33 +0000
(10:30 +0200)
plugins/mod_pep.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_pep.lua
b/plugins/mod_pep.lua
index 896f3e78b764842d04dfaee7c410d806f7c6ad38..01007a6de669ddc24dc9bd43ab237f9cb3c2e682 100644
(file)
--- 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)
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
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})
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", {
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
});
return true;
end