Comparison

mod_bookmarks/mod_bookmarks.lua @ 3253:cf8ad9fd7f15

mod_bookmarks: Use the new item-published/<node> event.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Tue, 21 Aug 2018 17:18:31 +0100
parent 3238:786ba175f2e5
child 3282:9346ed926842
comparison
equal deleted inserted replaced
3252:eec70a863d16 3253:cf8ad9fd7f15
112 end 112 end
113 module:log("debug", "Removed private bookmarks of %s, migration done!", username); 113 module:log("debug", "Removed private bookmarks of %s, migration done!", username);
114 end 114 end
115 115
116 local function on_item_published(event) 116 local function on_item_published(event)
117 if event.node == "storage:bookmarks" then 117 module:fire_event("bookmarks/updated", event);
118 module:fire_event("bookmarks/updated", event);
119 end
120 end 118 end
121 119
122 module:hook("iq-get/bare/jabber:iq:private:query", on_retrieve_private_xml); 120 module:hook("iq-get/bare/jabber:iq:private:query", on_retrieve_private_xml);
123 module:hook("iq-set/bare/jabber:iq:private:query", on_publish_private_xml); 121 module:hook("iq-set/bare/jabber:iq:private:query", on_publish_private_xml);
124 module:hook("resource-bind", on_resource_bind); 122 module:hook("resource-bind", on_resource_bind);
125 module:hook("item-published", on_item_published); 123 module:hook("item-published/storage:bookmarks", on_item_published);