aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2023-12-07 12:08:01 +0000
committerMatthew Wild <mwild1@gmail.com>2023-12-07 12:08:01 +0000
commit39d85bbc3184be315c52c491c75bd77e60b133d9 (patch)
tree1b4deb7da8eb8a08a05fcfb5bb5fe9087edb2054 /plugins
parentc35307551b603850281e3622c4e12fdf4d224895 (diff)
downloadprosody-39d85bbc3184be315c52c491c75bd77e60b133d9.tar.gz
prosody-39d85bbc3184be315c52c491c75bd77e60b133d9.zip
mod_user_account_management: Clear pending deletion if account re-enabled
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_user_account_management.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mod_user_account_management.lua b/plugins/mod_user_account_management.lua
index 4f32da00..c2a0e3a2 100644
--- a/plugins/mod_user_account_management.lua
+++ b/plugins/mod_user_account_management.lua
@@ -171,6 +171,12 @@ function restore_account(username)
return true, "Account restored";
end
+-- Automatically clear pending deletion if an account is re-enabled
+module:context("*"):hook("user-enabled", function (event)
+ if event.host ~= module.host then return; end
+ deleted_accounts:set(event.username, nil);
+end);
+
local cleanup_time = module:measure("cleanup", "times");
function cleanup_soft_deleted_accounts()