diff options
author | Adam <Adam@anope.org> | 2010-11-27 00:04:13 -0600 |
---|---|---|
committer | Adam <Adam@anope.org> | 2010-12-12 19:37:00 -0500 |
commit | 71c433cc502cc6073dd1e9d5cab3f49f8f6fd49e (patch) | |
tree | c9a463b9155471e11a067fd9306bfa152b189b51 /modules/extra | |
parent | 2b10cc84eab6cb9253611a090eb3ef67a6d3d0a7 (diff) |
The rest of the earlier command changes
Diffstat (limited to 'modules/extra')
-rw-r--r-- | modules/extra/cs_appendtopic.cpp | 16 | ||||
-rw-r--r-- | modules/extra/cs_enforce.cpp | 34 | ||||
-rw-r--r-- | modules/extra/cs_entrymsg.cpp | 18 | ||||
-rw-r--r-- | modules/extra/cs_set_misc.cpp | 12 | ||||
-rw-r--r-- | modules/extra/cs_tban.cpp | 18 | ||||
-rw-r--r-- | modules/extra/db_mysql.cpp | 8 | ||||
-rw-r--r-- | modules/extra/hs_request.cpp | 109 | ||||
-rw-r--r-- | modules/extra/m_alias.cpp | 3 | ||||
-rw-r--r-- | modules/extra/ns_maxemail.cpp | 21 | ||||
-rw-r--r-- | modules/extra/ns_set_misc.cpp | 12 |
10 files changed, 124 insertions, 127 deletions
diff --git a/modules/extra/cs_appendtopic.cpp b/modules/extra/cs_appendtopic.cpp index b98efeed6..d0320f516 100644 --- a/modules/extra/cs_appendtopic.cpp +++ b/modules/extra/cs_appendtopic.cpp @@ -85,25 +85,25 @@ class CommandCSAppendTopic : public Command return MOD_CONT; } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(ChanServ, u, _("Syntax: APPENDTOPIC channel text")); - u->SendMessage(Config->s_ChanServ, " "); - me->SendMessage(ChanServ, u, _("This command allows users to append text to a currently set\n" + me->SendMessage(source, _("Syntax: APPENDTOPIC channel text")); + source.Reply(" "); + me->SendMessage(source, _("This command allows users to append text to a currently set\n" "channel topic. When TOPICLOCK is on, the topic is updated and\n" "the new, updated topic is locked.")); return true; } - void OnSyntaxError(User *u, const Anope::string &subcommand) + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(ChanServ, u, _("Syntax: APPENDTOPIC channel text")); + me->SendMessage(source, _("Syntax: APPENDTOPIC channel text")); } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - me->SendMessage(ChanServ, u, _(" APPENDTOPIC Add text to a channels topic")); + me->SendMessage(source, _(" APPENDTOPIC Add text to a channels topic")); } }; diff --git a/modules/extra/cs_enforce.cpp b/modules/extra/cs_enforce.cpp index 4e21cf372..b15e23874 100644 --- a/modules/extra/cs_enforce.cpp +++ b/modules/extra/cs_enforce.cpp @@ -142,40 +142,40 @@ class CommandCSEnforce : public Command if (what.empty() || what.equals_ci("SET")) { this->DoSet(c); - me->SendMessage(ChanServ, u, _("Enforced %s"), !what.empty() ? what.c_str() : "SET"); + me->SendMessage(source, _("Enforced %s"), !what.empty() ? what.c_str() : "SET"); } else if (what.equals_ci("MODES")) { this->DoModes(c); - me->SendMessage(ChanServ, u, _("Enforced %s"), what.c_str()); + me->SendMessage(source, _("Enforced %s"), what.c_str()); } else if (what.equals_ci("SECUREOPS")) { this->DoSecureOps(c); - me->SendMessage(ChanServ, u, _("Enforced %s"), what.c_str()); + me->SendMessage(source, _("Enforced %s"), what.c_str()); } else if (what.equals_ci("RESTRICTED")) { this->DoRestricted(c); - me->SendMessage(ChanServ, u, _("Enforced %s"), what.c_str()); + me->SendMessage(source, _("Enforced %s"), what.c_str()); } else if (what.equals_ci("+R")) { this->DoCModeR(c); - me->SendMessage(ChanServ, u, _("Enforced %s"), what.c_str()); + me->SendMessage(source, _("Enforced %s"), what.c_str()); } else - this->OnSyntaxError(u, ""); + this->OnSyntaxError(source, ""); } return MOD_CONT; } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(ChanServ, u, _("Syntax: \002ENFORCE \037channel\037 [\037what\037]\002")); - me->SendMessage(ChanServ, u, " "); - me->SendMessage(ChanServ, u, _("Enforce various channel modes and set options. The \037channel\037\n" + me->SendMessage(source, _("Syntax: \002ENFORCE \037channel\037 [\037what\037]\002")); + me->SendMessage(source, " "); + me->SendMessage(source, _("Enforce various channel modes and set options. The \037channel\037\n" "option indicates what channel to enforce the modes and options\n" "on. The \037what\037 option indicates what modes and options to\n" "enforce, and can be any of SET, SECUREOPS, RESTRICTED, MODES,\n" @@ -186,14 +186,14 @@ class CommandCSEnforce : public Command "SECUREOPS to enforce the SECUREOPS option, even if it is not\n" "enabled. Use RESTRICTED to enfore the RESTRICTED option, also\n" "if it's not enabled.")); - me->SendMessage(ChanServ, u, " "); + me->SendMessage(source, " "); if (ModeManager::FindChannelModeByName(CMODE_REGISTERED)) - me->SendMessage(ChanServ, u, _("If \037what\037 is MODES, it will enforce channelmode +R if it is\n" + me->SendMessage(source, _("If \037what\037 is MODES, it will enforce channelmode +R if it is\n" "set. If +R is specified for \037what\037, the +R channelmode will\n" "also be enforced, but even if it is not set. If it is not set,\n" "users will be banned to ensure they don't just rejoin.")); else - me->SendMessage(ChanServ, u, _("If \037what\037 is MODES, nothing will be enforced, since it would\n" + me->SendMessage(source, _("If \037what\037 is MODES, nothing will be enforced, since it would\n" "enforce modes that the current ircd does not support. If +R is\n" "specified for \037what\037, an equalivant of channelmode +R on\n" "other ircds will be enforced. All users that are in the channel\n" @@ -203,14 +203,14 @@ class CommandCSEnforce : public Command return true; } - void OnSyntaxError(User *u, const Anope::string &subcommand) + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(ChanServ, u, _("Syntax: \002ENFORCE \037channel\037 [\037what\037]\002")); + me->SendMessage(source, _("Syntax: \002ENFORCE \037channel\037 [\037what\037]\002")); } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - me->SendMessage(ChanServ, u, _(" ENFORCE Enforce various channel modes and set options")); + me->SendMessage(source, _(" ENFORCE Enforce various channel modes and set options")); } }; diff --git a/modules/extra/cs_entrymsg.cpp b/modules/extra/cs_entrymsg.cpp index 4c6dee644..aae1b5f0e 100644 --- a/modules/extra/cs_entrymsg.cpp +++ b/modules/extra/cs_entrymsg.cpp @@ -109,7 +109,7 @@ class CommandEntryMessage : public Command else if (params.size() < 3) { success = false; - this->OnSyntaxError(u, ""); + this->OnSyntaxError(source, ""); } else if (params[1].equals_ci("ADD")) this->DoAdd(u, ci, params[2]); @@ -118,7 +118,7 @@ class CommandEntryMessage : public Command else { success = false; - this->OnSyntaxError(u, ""); + this->OnSyntaxError(source, ""); } if (success) Log(IsFounder(u, ci) ? LOG_COMMAND : LOG_OVERRIDE, u, this, ci) << params[1]; @@ -131,20 +131,20 @@ class CommandEntryMessage : public Command return MOD_CONT; } - void OnSyntaxError(User *u, const Anope::string &) + void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(ChanServ, u, "ENTRYMSG", CHAN_ENTRYMSG_SYNTAX); + SyntaxError(source, "ENTRYMSG", CHAN_ENTRYMSG_SYNTAX); } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - u->SendMessage(ChanServ, CHAN_HELP_ENTRYMSG); + source.Reply(CHAN_HELP_ENTRYMSG); return true; } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - u->SendMessage(ChanServ, CHAN_HELP_CMD_ENTRYMSG); + source.Reply(CHAN_HELP_CMD_ENTRYMSG); } }; @@ -174,7 +174,7 @@ class CSEntryMessage : public Module if (c->ci->GetExtRegular("cs_entrymsg", messages)) for (unsigned i = 0; i < messages.size(); ++i) - this->SendMessage(whosends(c->ci), u, "[%s] %s", c->ci->name.c_str(), messages[i].message.c_str()); + u->SendMessage(whosends(c->ci)->nick, "[%s] %s", c->ci->name.c_str(), messages[i].message.c_str()); } } diff --git a/modules/extra/cs_set_misc.cpp b/modules/extra/cs_set_misc.cpp index 0ed913b69..bdac568e5 100644 --- a/modules/extra/cs_set_misc.cpp +++ b/modules/extra/cs_set_misc.cpp @@ -39,14 +39,14 @@ class CommandCSSetMisc : public Command return MOD_CONT; } - void OnSyntaxError(User *u, const Anope::string &) + void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(ChanServ, u, "SET", CHAN_SET_SYNTAX); + SyntaxError(source, "SET", CHAN_SET_SYNTAX); } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - u->SendMessage(Config->s_ChanServ, " %-10s %s", this->name.c_str(), this->Desc.c_str()); + source.Reply(" %-10s %s", this->name.c_str(), this->Desc.c_str()); } }; @@ -57,9 +57,9 @@ class CommandCSSASetMisc : public CommandCSSetMisc { } - void OnSyntaxError(User *u, const Anope::string &) + void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(ChanServ, u, "SASET", CHAN_SASET_SYNTAX); + SyntaxError(source, "SASET", CHAN_SASET_SYNTAX); } }; diff --git a/modules/extra/cs_tban.cpp b/modules/extra/cs_tban.cpp index a037c8243..af29e76f6 100644 --- a/modules/extra/cs_tban.cpp +++ b/modules/extra/cs_tban.cpp @@ -80,30 +80,30 @@ class CommandCSTBan : public Command get_idealban(c->ci, u2, mask); c->SetMode(NULL, CMODE_BAN, mask); new TempBan(dotime(time), c, mask); - me->SendMessage(ChanServ, u, _("%s banned from %s, will auto-expire in %s"), mask.c_str(), c->name.c_str(), time.c_str()); + me->SendMessage(source, _("%s banned from %s, will auto-expire in %s"), mask.c_str(), c->name.c_str(), time.c_str()); } return MOD_CONT; } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - this->OnSyntaxError(u, ""); - me->SendMessage(ChanServ, u, " "); - me->SendMessage(ChanServ, u, _("Bans the given user from a channel for a specified length of\n" + this->OnSyntaxError(source, ""); + me->SendMessage(source, " "); + me->SendMessage(source, _("Bans the given user from a channel for a specified length of\n" "time. If the ban is removed before by hand, it will NOT be replaced.")); return true; } - void OnSyntaxError(User *u, const Anope::string &subcommand) + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(ChanServ, u, _("Syntax: TBAN channel nick time")); + me->SendMessage(source, _("Syntax: TBAN channel nick time")); } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - me->SendMessage(ChanServ, u, _(" TBAN Bans the user for a given length of time")); + me->SendMessage(source, _(" TBAN Bans the user for a given length of time")); } }; diff --git a/modules/extra/db_mysql.cpp b/modules/extra/db_mysql.cpp index b2f60236b..6c6c1c9e0 100644 --- a/modules/extra/db_mysql.cpp +++ b/modules/extra/db_mysql.cpp @@ -316,15 +316,15 @@ class CommandSQLSync : public Command CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms); - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - u->SendMessage(OperServ, OPER_HELP_SYNC); + source.Reply(OPER_HELP_SYNC); return true; } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - u->SendMessage(OperServ, OPER_HELP_CMD_SQLSYNC); + source.Reply(OPER_HELP_CMD_SQLSYNC); } }; diff --git a/modules/extra/hs_request.cpp b/modules/extra/hs_request.cpp index 031fa72b7..fbba8bb02 100644 --- a/modules/extra/hs_request.cpp +++ b/modules/extra/hs_request.cpp @@ -21,7 +21,7 @@ static bool HSRequestMemoUser = false; static bool HSRequestMemoOper = false; void my_add_host_request(const Anope::string &nick, const Anope::string &vIdent, const Anope::string &vhost, const Anope::string &creator, time_t tmp_time); -void req_send_memos(User *u, const Anope::string &vIdent, const Anope::string &vHost); +void req_send_memos(CommandSource &source, const Anope::string &vIdent, const Anope::string &vHost); struct HostRequest { @@ -62,24 +62,24 @@ class CommandHSRequest : public Command rawhostmask = myStrGetTokenRemainder(rawhostmask, '@', 1); /* get the remaining string */ if (rawhostmask.empty()) { - me->SendMessage(HostServ, u, _("Syntax: \002REQUEST \037vhost\037\002")); + me->SendMessage(source, _("Syntax: \002REQUEST \037vhost\037\002")); return MOD_CONT; } if (vIdent.length() > Config->UserLen) { - u->SendMessage(HostServ, HOST_SET_IDENTTOOLONG, Config->UserLen); + source.Reply(HOST_SET_IDENTTOOLONG, Config->UserLen); return MOD_CONT; } else for (Anope::string::iterator s = vIdent.begin(), s_end = vIdent.end(); s != s_end; ++s) if (!isvalidchar(*s)) { - u->SendMessage(HostServ, HOST_SET_IDENT_ERROR); + source.Reply(HOST_SET_IDENT_ERROR); return MOD_CONT; } if (!ircd->vident) { - u->SendMessage(HostServ, HOST_NO_VIDENT); + source.Reply(HOST_NO_VIDENT); return MOD_CONT; } } @@ -87,49 +87,49 @@ class CommandHSRequest : public Command hostmask = rawhostmask; else { - u->SendMessage(HostServ, HOST_SET_TOOLONG, Config->HostLen); + source.Reply(HOST_SET_TOOLONG, Config->HostLen); return MOD_CONT; } if (!isValidHost(hostmask, 3)) { - u->SendMessage(HostServ, HOST_SET_ERROR); + source.Reply(HOST_SET_ERROR); return MOD_CONT; } if (HSRequestMemoOper && Config->MSSendDelay > 0 && u && u->lastmemosend + Config->MSSendDelay > Anope::CurTime) { - me->SendMessage(HostServ, u, _("Please wait %d seconds before requesting a new vHost"), Config->MSSendDelay); + me->SendMessage(source, _("Please wait %d seconds before requesting a new vHost"), Config->MSSendDelay); u->lastmemosend = Anope::CurTime; return MOD_CONT; } my_add_host_request(u->nick, vIdent, hostmask, u->nick, Anope::CurTime); - me->SendMessage(HostServ, u, _("Your vHost has been requested")); - req_send_memos(u, vIdent, hostmask); + me->SendMessage(source, _("Your vHost has been requested")); + req_send_memos(source, vIdent, hostmask); Log(LOG_COMMAND, u, this, NULL) << "to request new vhost " << (!vIdent.empty() ? vIdent + "@" : "") << hostmask; return MOD_CONT; } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(HostServ, u, _("Syntax: \002REQUEST \037vhost\037\002")); - me->SendMessage(HostServ, u, " "); - me->SendMessage(HostServ, u, _("Request the given vHost to be actived for your nick by the\n" + me->SendMessage(source, _("Syntax: \002REQUEST \037vhost\037\002")); + me->SendMessage(source, " "); + me->SendMessage(source, _("Request the given vHost to be actived for your nick by the\n" "network administrators. Please be patient while your request\n" "is being considered.")); return true; } - void OnSyntaxError(User *u, const Anope::string &subcommand) + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(HostServ, u, _("Syntax: \002REQUEST \037vhost\037\002")); + me->SendMessage(source, _("Syntax: \002REQUEST \037vhost\037\002")); } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - me->SendMessage(HostServ, u, _(" REQUEST Request a vHost for your nick")); + me->SendMessage(source, _(" REQUEST Request a vHost for your nick")); } }; @@ -155,15 +155,15 @@ class CommandHSActivate : public Command na->hostinfo.SetVhost(it->second->ident, it->second->host, u->nick, it->second->time); if (HSRequestMemoUser) - memo_send(u, na->nick, _("[auto memo] Your requested vHost has been approved."), 2); + memo_send(source, na->nick, _("[auto memo] Your requested vHost has been approved."), 2); - me->SendMessage(HostServ, u, _("vHost for %s has been activated"), na->nick.c_str()); + me->SendMessage(source, _("vHost for %s has been activated"), na->nick.c_str()); Log(LOG_COMMAND, u, this, NULL) << "for " << na->nick << " for vhost " << (!it->second->ident.empty() ? it->second->ident + "@" : "") << it->second->host; delete it->second; Requests.erase(it); } else - me->SendMessage(HostServ, u, _("No request for nick %s found."), nick.c_str()); + me->SendMessage(source, _("No request for nick %s found."), nick.c_str()); } else u->SendMessage(HostServ, NICK_X_NOT_REGISTERED, nick.c_str()); @@ -171,25 +171,25 @@ class CommandHSActivate : public Command return MOD_CONT; } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(HostServ, u, _("Syntax: \002ACTIVATE \037nick\037\002")); - me->SendMessage(HostServ, u, " "); - me->SendMessage(HostServ, u, _("Activate the requested vHost for the given nick.")); + me->SendMessage(source, _("Syntax: \002ACTIVATE \037nick\037\002")); + me->SendMessage(source, " "); + me->SendMessage(source, _("Activate the requested vHost for the given nick.")); if (HSRequestMemoUser) - me->SendMessage(HostServ, u, _("A memo informing the user will also be sent.")); + me->SendMessage(source, _("A memo informing the user will also be sent.")); return true; } - void OnSyntaxError(User *u, const Anope::string &subcommand) + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(HostServ, u, _("Syntax: \002ACTIVATE \037nick\037\002")); + me->SendMessage(source, _("Syntax: \002ACTIVATE \037nick\037\002")); } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - me->SendMessage(HostServ, u, _(" ACTIVATE Approve the requested vHost of a user\n" + me->SendMessage(source, _(" ACTIVATE Approve the requested vHost of a user\n" " REJECT Reject the requested vHost of a user\n" " WAITING Convenience command for LIST +req")); } @@ -223,32 +223,32 @@ class CommandHSReject : public Command else snprintf(message, sizeof(message), _("[auto memo] Your requested vHost has been rejected.")); - memo_send(u, nick, message, 2); + memo_send(source, nick, message, 2); } - me->SendMessage(HostServ, u, _("vHost for %s has been rejected"), nick.c_str()); + me->SendMessage(source, _("vHost for %s has been rejected"), nick.c_str()); Log(LOG_COMMAND, u, this, NULL) << "to reject vhost for " << nick << " (" << (!reason.empty() ? reason : "") << ")"; } else - me->SendMessage(HostServ, u, _("No request for nick %s found."), nick.c_str()); + me->SendMessage(source, _("No request for nick %s found."), nick.c_str()); return MOD_CONT; } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(HostServ, u, _("Syntax: \002REJECT \037nick\037\002")); - me->SendMessage(HostServ, u, " "); - me->SendMessage(HostServ, u, _("Reject the requested vHost for the given nick.")); + me->SendMessage(source, _("Syntax: \002REJECT \037nick\037\002")); + me->SendMessage(source, " "); + me->SendMessage(source, _("Reject the requested vHost for the given nick.")); if (HSRequestMemoUser) - me->SendMessage(HostServ, u, _("A memo informing the user will also be sent.")); + me->SendMessage(source, _("A memo informing the user will also be sent.")); return true; } - void OnSyntaxError(User *u, const Anope::string &subcommand) + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(HostServ, u, _("Syntax: \002REJECT \037nick\037\002")); + me->SendMessage(source, _("Syntax: \002REJECT \037nick\037\002")); } }; @@ -283,7 +283,7 @@ class HSListBase : public Command { } - void OnSyntaxError(User *u, const Anope::string &subcommand) + void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) { // no-op } @@ -301,11 +301,11 @@ class CommandHSWaiting : public HSListBase return this->DoList(source.u); } - bool OnHelp(User *u, const Anope::string &subcommand) + bool OnHelp(CommandSource &source, const Anope::string &subcommand) { - me->SendMessage(HostServ, u, _("Syntax: \002WAITING\002")); - me->SendMessage(HostServ, u, " "); - me->SendMessage(HostServ, u, _("This command is provided for convenience. It is essentially\n" + me->SendMessage(source, _("Syntax: \002WAITING\002")); + me->SendMessage(source, " "); + me->SendMessage(source, _("This command is provided for convenience. It is essentially\n" "the same as performing a LIST +req .")); return true; @@ -348,11 +348,12 @@ class HSRequest : public Module } } - EventReturn OnPreCommand(User *u, BotInfo *service, const Anope::string &command, const std::vector<Anope::string> ¶ms) + EventReturn OnPreCommand(CommandSource &source, Command *command, const std::vector<Anope::string> ¶ms) { + BotInfo *service = source.owner; if (service == HostServ) { - if (command.equals_ci("LIST")) + if (command->name.equals_ci("LIST")) { Anope::string key = params.size() ? params[0] : ""; @@ -362,12 +363,6 @@ class HSRequest : public Module Command *c = FindCommand(HostServ, "WAITING"); if (!c) throw CoreException("No waiting command?"); - CommandSource source; - source.u = u; - source.ci = NULL; - source.owner = service; - source.service = service; - source.fantasy = false; c->Execute(source, emptyParams); return EVENT_STOP; } @@ -375,9 +370,9 @@ class HSRequest : public Module } else if (service == NickServ) { - if (command.equals_ci("DROP")) + if (command->name.equals_ci("DROP")) { - NickAlias *na = findnick(u->nick); + NickAlias *na = findnick(source.u->nick); if (na) { @@ -429,7 +424,7 @@ class HSRequest : public Module } }; -void req_send_memos(User *u, const Anope::string &vIdent, const Anope::string &vHost) +void req_send_memos(CommandSource &source, const Anope::string &vIdent, const Anope::string &vHost) { Anope::string host; std::list<std::pair<Anope::string, Anope::string> >::iterator it, it_end; @@ -445,7 +440,7 @@ void req_send_memos(User *u, const Anope::string &vIdent, const Anope::string &v Anope::string nick = it->first; char message[BUFSIZE]; snprintf(message, sizeof(message), _("[auto memo] vHost \002%s\002 has been requested."), host.c_str()); - memo_send(u, nick, message, 2); + memo_send(source, nick, message, 2); } } diff --git a/modules/extra/m_alias.cpp b/modules/extra/m_alias.cpp index 4eac38179..de23557a3 100644 --- a/modules/extra/m_alias.cpp +++ b/modules/extra/m_alias.cpp @@ -56,8 +56,9 @@ class ModuleAlias : public Module } } - EventReturn OnPreCommandRun(User *u, BotInfo *bi, Anope::string &command, Anope::string &message, bool fantasy) + EventReturn OnPreCommandRun(User *u, BotInfo *bi, Anope::string &command, Anope::string &message, ChannelInfo *ci) { + bool fantasy = ci != NULL; std::map<Anope::string, CommandAlias, std::less<ci::string> >::const_iterator it = aliases.find(command); if (it != aliases.end()) { diff --git a/modules/extra/ns_maxemail.cpp b/modules/extra/ns_maxemail.cpp index 9be204d29..ddde5d740 100644 --- a/modules/extra/ns_maxemail.cpp +++ b/modules/extra/ns_maxemail.cpp @@ -19,18 +19,18 @@ class NSMaxEmail : public Module { int NSEmailMax; - bool CheckLimitReached(const Anope::string &email, User *u) + bool CheckLimitReached(CommandSource &source, const Anope::string &email) { if (this->NSEmailMax < 1 || email.empty()) return false; - if (this->CountEmail(email, u) < this->NSEmailMax) + if (this->CountEmail(email, source.u) < this->NSEmailMax) return false; if (this->NSEmailMax == 1) - this->SendMessage(NickServ, u, _("The given email address has reached it's usage limit of 1 user.")); + this->SendMessage(source, _("The given email address has reached it's usage limit of 1 user.")); else - this->SendMessage(NickServ, u, _("The given email address has reached it's usage limit of %d users."), this->NSEmailMax); + this->SendMessage(source, _("The given email address has reached it's usage limit of %d users."), this->NSEmailMax); return true; } @@ -72,21 +72,22 @@ class NSMaxEmail : public Module Log(LOG_DEBUG) << "[ns_maxemail] NSEmailMax set to " << NSEmailMax; } - EventReturn OnPreCommand(User *u, BotInfo *service, const Anope::string &command, const std::vector<Anope::string> ¶ms) + EventReturn OnPreCommand(CommandSource &source, Command *command, const std::vector<Anope::string> ¶ms) { - if (service == findbot(Config->s_NickServ)) + BotInfo *service = source.owner; + if (service == NickServ) { - if (command.equals_ci("REGISTER")) + if (command->name.equals_ci("REGISTER")) { - if (CheckLimitReached(params.size() > 1 ? params[1] : "", u)) + if (this->CheckLimitReached(source, params.size() > 1 ? params[1] : "")) return EVENT_STOP; } - else if (command.equals_ci("SET")) + 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") && CheckLimitReached(email, u)) + if (set.equals_ci("email") && this->CheckLimitReached(source, email)) return EVENT_STOP; } } diff --git a/modules/extra/ns_set_misc.cpp b/modules/extra/ns_set_misc.cpp index f7a2f815f..87263fd64 100644 --- a/modules/extra/ns_set_misc.cpp +++ b/modules/extra/ns_set_misc.cpp @@ -43,14 +43,14 @@ class CommandNSSetMisc : public Command return MOD_CONT; } - void OnSyntaxError(User *u, const Anope::string &) + void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(NickServ, u, "SET", NICK_SET_SYNTAX); + SyntaxError(source, "SET", NICK_SET_SYNTAX); } - void OnServHelp(User *u) + void OnServHelp(CommandSource &source) { - u->SendMessage(Config->s_NickServ, " %-10s %s", this->name.c_str(), this->Desc.c_str()); + source.Reply(" %-10s %s", this->name.c_str(), this->Desc.c_str()); } }; @@ -61,9 +61,9 @@ class CommandNSSASetMisc : public CommandNSSetMisc { } - void OnSyntaxError(User *u, const Anope::string &) + void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(NickServ, u, "SASET", NICK_SASET_SYNTAX); + SyntaxError(source, "SASET", NICK_SASET_SYNTAX); } }; |