changeset 3782:70e5bab388d8

mod_measure_message_e2ee: Make this module non-global; users can aggregate data if they care about that
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 29 Dec 2019 20:42:34 +0100
parents 263f5f1ee71f
children 908b5fd47634
files mod_measure_message_e2ee/mod_measure_message_e2ee.lua
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mod_measure_message_e2ee/mod_measure_message_e2ee.lua	Sun Dec 29 19:53:23 2019 +0100
+++ b/mod_measure_message_e2ee/mod_measure_message_e2ee.lua	Sun Dec 29 20:42:34 2019 +0100
@@ -1,5 +1,3 @@
-module:set_global();
-
 local count_message = module:measure("message", "rate");
 local count_plain = module:measure("plain", "rate");
 local count_openpgp = module:measure("openpgp", "rate");
@@ -45,9 +43,6 @@
 	end
 end
 
-function module.add_host(host_module)
-	module:log("debug", "Loaded on host %s", host_module);
-	host_module:hook("pre-message/host", message_handler, 2);
-	host_module:hook("pre-message/bare", message_handler, 2);
-	host_module:hook("pre-message/full", message_handler, 2);
-end
+module:hook("pre-message/host", message_handler, 2);
+module:hook("pre-message/bare", message_handler, 2);
+module:hook("pre-message/full", message_handler, 2);