mod_blocklist: Decrease priority of iq hooks to ease handling by other modules
authorKim Alvefur <zash@zash.se>
Sat, 20 Aug 2016 17:24:08 +0200
changeset 7623 c27c9695d130
parent 7621 5a09c1166d89
child 7624 b8c03df6e8ca
mod_blocklist: Decrease priority of iq hooks to ease handling by other modules
plugins/mod_blocklist.lua
--- a/plugins/mod_blocklist.lua	Fri Aug 19 16:25:15 2016 +0200
+++ b/plugins/mod_blocklist.lua	Sat Aug 20 17:24:08 2016 +0200
@@ -113,7 +113,7 @@
 	origin.interested_blocklist = true; -- Gets notified about changes
 	origin.send(reply);
 	return true;
-end);
+end, -1);
 
 -- Add or remove some jid(s) from the blocklist
 -- We want this to be atomic and not do a partial update
@@ -215,8 +215,8 @@
 	return true;
 end
 
-module:hook("iq-set/self/urn:xmpp:blocking:block", edit_blocklist);
-module:hook("iq-set/self/urn:xmpp:blocking:unblock", edit_blocklist);
+module:hook("iq-set/self/urn:xmpp:blocking:block", edit_blocklist, -1);
+module:hook("iq-set/self/urn:xmpp:blocking:unblock", edit_blocklist, -1);
 
 -- Cache invalidation, solved!
 module:hook_global("user-deleted", function (event)