Software /
code /
verse
Diff
plugins/pep.lua @ 380:0891b4e27766
Discard trailing whitespace
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Fri, 01 May 2015 23:27:29 +0200 |
parent | 268:06e6c6de6438 |
child | 415:37674f8ce263 |
line wrap: on
line diff
--- a/plugins/pep.lua Fri May 01 21:46:24 2015 +0200 +++ b/plugins/pep.lua Fri May 01 23:27:29 2015 +0200 @@ -7,11 +7,11 @@ stream:add_plugin("disco"); stream:add_plugin("pubsub"); stream.pep = {}; - + stream:hook("pubsub/event", function(event) return stream:event("pep/"..event.node, { from = event.from, item = event.item.tags[1] } ); end); - + function stream:hook_pep(node, callback, priority) local handlers = stream.events._handlers["pep/"..node]; if not(handlers) or #handlers == 0 then @@ -19,7 +19,7 @@ end stream:hook("pep/"..node, callback, priority); end - + function stream:unhook_pep(node, callback) stream:unhook("pep/"..node, callback); local handlers = stream.events._handlers["pep/"..node]; @@ -27,7 +27,7 @@ stream:remove_disco_feature(node.."+notify"); end end - + function stream:publish_pep(item, node) return stream.pubsub:service(nil):node(node or item.attr.xmlns):publish(nil, nil, item) end