diff options
-rw-r--r-- | data/nickserv.example.conf | 4 | ||||
-rw-r--r-- | modules/ns_maxemail.cpp | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/data/nickserv.example.conf b/data/nickserv.example.conf index 0c7fd49c6..f6c47ad0c 100644 --- a/data/nickserv.example.conf +++ b/data/nickserv.example.conf @@ -640,7 +640,7 @@ command { service = "NickServ"; name = "UPDATE"; command = "nickserv/update"; } * Limits how many times the same email address may be used in Anope * to register accounts. */ -module +#module { name = "ns_maxemail" @@ -649,5 +649,5 @@ module * commented, there will be no limit enforced when registering new accounts or using * /msg NickServ SET EMAIL. */ - #maxemails = 1 + maxemails = 1 } diff --git a/modules/ns_maxemail.cpp b/modules/ns_maxemail.cpp index cbe74fdaf..432fe81d0 100644 --- a/modules/ns_maxemail.cpp +++ b/modules/ns_maxemail.cpp @@ -25,9 +25,9 @@ class NSMaxEmail : public Module return false; if (NSEmailMax == 1) - source.Reply(_("The given email address has reached its usage limit of 1 user.")); + source.Reply(_("The email address \2%s\2 has reached its usage limit of 1 user."), email.c_str()); else - source.Reply(_("The given email address has reached its usage limit of %d users."), NSEmailMax); + source.Reply(_("The email address \2%s\2 has reached its usage limit of %d users."), email.c_str(), NSEmailMax); return true; } @@ -57,6 +57,9 @@ class NSMaxEmail : public Module EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> ¶ms) anope_override { + if (source.IsOper()) + return EVENT_CONTINUE; + if (command->name == "nickserv/register") { if (this->CheckLimitReached(source, params.size() > 1 ? params[1] : "")) @@ -67,6 +70,11 @@ class NSMaxEmail : public Module if (this->CheckLimitReached(source, params.size() > 0 ? params[0] : "")) return EVENT_STOP; } + else if (command->name == "nickserv/ungroup" && source.GetAccount()) + { + if (this->CheckLimitReached(source, source.GetAccount()->email)) + return EVENT_STOP; + } return EVENT_CONTINUE; } |