summaryrefslogtreecommitdiff
path: root/modules/extra/ns_maxemail.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-07-14 02:31:12 -0400
committerAdam <Adam@anope.org>2011-07-14 02:31:12 -0400
commitf858164deed48f2dcacd5ffc06a55398a54da7e8 (patch)
tree89c3cf36bd8e94942370135218d67d6d17ee222e /modules/extra/ns_maxemail.cpp
parent924f6849fee4598a1a3a7f1a98d96b79e5ffd3b4 (diff)
Rewrote how commands are handled within Anope.
This allows naming commands and having spaces within command names.
Diffstat (limited to 'modules/extra/ns_maxemail.cpp')
-rw-r--r--modules/extra/ns_maxemail.cpp25
1 files changed, 9 insertions, 16 deletions
diff --git a/modules/extra/ns_maxemail.cpp b/modules/extra/ns_maxemail.cpp
index 25feffd79..18be74bce 100644
--- a/modules/extra/ns_maxemail.cpp
+++ b/modules/extra/ns_maxemail.cpp
@@ -71,24 +71,17 @@ class NSMaxEmail : public Module
Log(LOG_DEBUG) << "[ns_maxemail] NSEmailMax set to " << NSEmailMax;
}
- EventReturn OnPreCommand(CommandSource &source, Command *command, const std::vector<Anope::string> &params)
+ EventReturn OnPreCommand(CommandSource &source, Command *command, std::vector<Anope::string> &params)
{
- BotInfo *service = source.owner;
- if (service->nick == Config->s_NickServ)
+ if (command->name == "nickserv/register")
{
- if (command->name.equals_ci("REGISTER"))
- {
- if (this->CheckLimitReached(source, params.size() > 1 ? params[1] : ""))
- return EVENT_STOP;
- }
- else if (command->name.equals_ci("SET"))
- {
- Anope::string set = params[0];
- Anope::string email = params.size() > 1 ? params[1] : "";
-
- if (set.equals_ci("email") && this->CheckLimitReached(source, email))
- return EVENT_STOP;
- }
+ if (this->CheckLimitReached(source, params.size() > 1 ? params[1] : ""))
+ return EVENT_STOP;
+ }
+ else if (command->name == "nickserv/set/email")
+ {
+ if (this->CheckLimitReached(source, params.size() > 0 ? params[0] : ""))
+ return EVENT_STOP;
}
return EVENT_CONTINUE;