Mercurial > prosody-modules
comparison mod_bookmarks/mod_bookmarks.lua @ 3308:7155cc1adf8f
mod_bookmarks: Handle iq:private queries before mod_private
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 09 Sep 2018 14:10:22 +0200 |
parents | 303b17ec8264 |
children | fd889eb16541 |
comparison
equal
deleted
inserted
replaced
3307:303b17ec8264 | 3308:7155cc1adf8f |
---|---|
133 for config_field, value in pairs(default_options) do | 133 for config_field, value in pairs(default_options) do |
134 node_config[config_field] = value; | 134 node_config[config_field] = value; |
135 end | 135 end |
136 end | 136 end |
137 | 137 |
138 module:hook("iq-get/bare/jabber:iq:private:query", on_retrieve_private_xml); | 138 module:hook("iq/bare/jabber:iq:private:query", function (event) |
139 module:hook("iq-set/bare/jabber:iq:private:query", on_publish_private_xml); | 139 if event.stanza.attr.type == "get" then |
140 return on_retrieve_private_xml(event); | |
141 else | |
142 return on_publish_private_xml(event); | |
143 end | |
144 end, 1); | |
140 module:hook("resource-bind", on_resource_bind); | 145 module:hook("resource-bind", on_resource_bind); |
141 module:hook("item-published/storage:bookmarks", on_item_published); | 146 module:hook("item-published/storage:bookmarks", on_item_published); |
142 module:handle_items("pep-service", function (event) | 147 module:handle_items("pep-service", function (event) |
143 local service = event.item.service; | 148 local service = event.item.service; |
144 module:hook_object_event(service.events, "node-created", on_node_created); | 149 module:hook_object_event(service.events, "node-created", on_node_created); |