diff 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
line wrap: on
line diff
--- a/mod_bookmarks/mod_bookmarks.lua	Sun Sep 09 14:09:12 2018 +0200
+++ b/mod_bookmarks/mod_bookmarks.lua	Sun Sep 09 14:10:22 2018 +0200
@@ -135,8 +135,13 @@
 	end
 end
 
-module:hook("iq-get/bare/jabber:iq:private:query", on_retrieve_private_xml);
-module:hook("iq-set/bare/jabber:iq:private:query", on_publish_private_xml);
+module:hook("iq/bare/jabber:iq:private:query", function (event)
+	if event.stanza.attr.type == "get" then
+		return on_retrieve_private_xml(event);
+	else
+		return on_publish_private_xml(event);
+	end
+end, 1);
 module:hook("resource-bind", on_resource_bind);
 module:hook("item-published/storage:bookmarks", on_item_published);
 module:handle_items("pep-service", function (event)