summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-09-07 08:46:28 -0400
committerAdam <Adam@anope.org>2012-09-07 08:46:28 -0400
commit5c07863ad503edfc8deb1dee38e6222602db54fd (patch)
treebdea6b8d44b937c770fbd0efcba7e4e45200f98d
parent306037525181b3e4aad1f53cea2b3f46603d77a2 (diff)
Allow configuring killquick and kill delays
-rw-r--r--data/nickserv.example.conf7
-rw-r--r--include/config.h3
-rw-r--r--modules/pseudoclients/nickserv.cpp8
-rw-r--r--src/config.cpp2
4 files changed, 16 insertions, 4 deletions
diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf
index 599656ce5..5db22cfdc 100644
--- a/data/nickserv.example.conf
+++ b/data/nickserv.example.conf
@@ -256,6 +256,13 @@ nickserv
* The maximum number of channels a user can have on NickServ's AJOIN command.
*/
ajoinmax = 10
+
+ /*
+ * If set, is the length of time NickServ's killquick and kill options wait before
+ * forcing users off of protected nicknames.
+ */
+ killquick = 20s
+ kill = 60s
}
/*
diff --git a/include/config.h b/include/config.h
index e37028bcf..775f03aa8 100644
--- a/include/config.h
+++ b/include/config.h
@@ -548,6 +548,9 @@ class CoreExport ServerConfig
bool NSAddAccessOnReg;
/* Maximum number of channels on AJoin */
unsigned AJoinMax;
+ /* Kill & killquick delays before force changing off users */
+ time_t NSKillQuick;
+ time_t NSKill;
/* Core ChanServ modules */
Anope::string ChanCoreModules;
diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp
index 34b945f08..6307434de 100644
--- a/modules/pseudoclients/nickserv.cpp
+++ b/modules/pseudoclients/nickserv.cpp
@@ -124,13 +124,13 @@ class MyNickServService : public NickServService
}
else if (na->nc->HasFlag(NI_KILL_QUICK))
{
- u->SendMessage(NickServ, _("If you do not change within 20 seconds, I will change your nick."));
- new NickServCollide(u, 20);
+ u->SendMessage(NickServ, _("If you do not change within %s, I will change your nick."), duration(Config->NSKillQuick, u->Account()).c_str());
+ new NickServCollide(u, Config->NSKillQuick);
}
else
{
- u->SendMessage(NickServ, _("If you do not change within one minute, I will change your nick."));
- new NickServCollide(u, 60);
+ u->SendMessage(NickServ, _("If you do not change within %s, I will change your nick."), duration(Config->NSKill, u->Account()).c_str());
+ new NickServCollide(u, Config->NSKill);
}
}
diff --git a/src/config.cpp b/src/config.cpp
index a5e07596d..91cf8a805 100644
--- a/src/config.cpp
+++ b/src/config.cpp
@@ -1212,6 +1212,8 @@ ConfigItems::ConfigItems(ServerConfig *conf)
{"nickserv", "modeonid", "no", new ValueContainerBool(&conf->NSModeOnID), DT_BOOLEAN, NoValidation},
{"nickserv", "addaccessonreg", "no", new ValueContainerBool(&conf->NSAddAccessOnReg), DT_BOOLEAN, NoValidation},
{"nickserv", "ajoinmax", "10", new ValueContainerUInt(&conf->AJoinMax), DT_UINTEGER, NoValidation},
+ {"nickserv", "killquick", "20", new ValueContainerTime(&conf->NSKillQuick), DT_TIME, NoValidation},
+ {"nickserv", "kill", "60", new ValueContainerTime(&conf->NSKill), DT_TIME, NoValidation},
{"mail", "usemail", "no", new ValueContainerBool(&conf->UseMail), DT_BOOLEAN, ValidateEmailReg},
{"mail", "sendmailpath", "", new ValueContainerString(&conf->SendMailPath), DT_STRING, ValidateMail},
{"mail", "sendfrom", "", new ValueContainerString(&conf->SendFrom), DT_STRING, ValidateMail},