mod_mimicking: Correctly hook the *global* user-deleted event
authorKim Alvefur <zash@zash.se>
Tue, 12 Oct 2021 17:55:53 +0200
changeset 11852 b4d4f0339e16
parent 11851 2b3ce80ffece
child 11853 7440d610e5f1
mod_mimicking: Correctly hook the *global* user-deleted event
plugins/mod_mimicking.lua
--- a/plugins/mod_mimicking.lua	Tue Oct 12 15:00:15 2021 +0200
+++ b/plugins/mod_mimicking.lua	Tue Oct 12 17:55:53 2021 +0200
@@ -29,7 +29,8 @@
 	end
 end);
 
-module:hook("user-deleted", function(user)
+module:hook_global("user-deleted", function(user)
+	if user.host ~= module.host then return end
 	local skel = skeleton(user.username);
 	local ok, err = skeletons:set(skel, nil);
 	if not ok and err then