Software /
code /
prosody-modules
Diff
mod_bookmarks/mod_bookmarks.lua @ 3307:303b17ec8264
mod_bookmarks: Correctly hook events on PEP services
Since each user has its own util.pubsub instance, this is needed to hook
all of them.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Sep 2018 14:09:12 +0200 |
parent | 3294:947790ec4406 |
child | 3308:7155cc1adf8f |
line wrap: on
line diff
--- a/mod_bookmarks/mod_bookmarks.lua Sun Sep 09 13:11:29 2018 +0200 +++ b/mod_bookmarks/mod_bookmarks.lua Sun Sep 09 14:09:12 2018 +0200 @@ -139,4 +139,7 @@ module:hook("iq-set/bare/jabber:iq:private:query", on_publish_private_xml); module:hook("resource-bind", on_resource_bind); module:hook("item-published/storage:bookmarks", on_item_published); -module:hook("node-created", on_node_created); +module:handle_items("pep-service", function (event) + local service = event.item.service; + module:hook_object_event(service.events, "node-created", on_node_created); +end, function () end, true);