summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2025-03-08 13:36:41 +0000
committerSadie Powell <sadie@witchery.services>2025-03-08 14:07:15 +0000
commit62bfa33464df8cc413fa4f111ab62e189be0ca32 (patch)
tree5dd8b0bb0caa1fc3c76e05253641f332a3c10af4 /src
parentb4ab7dadb94c463b46e8bef5bce8c8c531bf1995 (diff)
Rework how nickname protection works.
- Rename the command and module from kill to protect (this command hasn't actually killed users in a long time). - Replace QUICK/IMMED with a duration option.
Diffstat (limited to 'src')
-rw-r--r--src/nickcore.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index 756b40d83..9b44dc61a 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -146,7 +146,29 @@ Serializable *NickCore::Unserialize(Serializable *obj, Serialize::Data &data)
b = false;
data["extensible:KILLPROTECT"] >> b;
if (b)
- nc->Extend<bool>("KILLPROTECT");
+ nc->Extend<bool>("PROTECT");
+
+ b = false;
+ data["KILLPROTECT"] >> b;
+ if (b)
+ {
+ nc->Extend<bool>("PROTECT");
+ nc->Extend("PROTECT_AFTER", Config->GetModule("nickserv").Get<time_t>("kill", "60s"));
+ }
+ b = false;
+ data["KILL_QUICK"] >> b;
+ if (b)
+ {
+ nc->Extend<bool>("PROTECT");
+ nc->Extend("PROTECT_AFTER", Config->GetModule("nickserv").Get<time_t>("killquick", "20s"));
+ }
+ b = false;
+ data["KILL_IMMED"] >> b;
+ if (b)
+ {
+ nc->Extend<bool>("PROTECT");
+ nc->Extend("PROTECT_AFTER", 0);
+ }
/* end compat */
return nc;