diff options
Diffstat (limited to 'modules/extra')
| -rw-r--r-- | modules/extra/cs_appendtopic.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/cs_enforce.cpp | 10 | ||||
| -rw-r--r-- | modules/extra/cs_entrymsg.cpp | 4 | ||||
| -rw-r--r-- | modules/extra/cs_set_misc.cpp | 12 | ||||
| -rw-r--r-- | modules/extra/cs_tban.cpp | 16 | ||||
| -rw-r--r-- | modules/extra/hs_request.cpp | 27 | ||||
| -rw-r--r-- | modules/extra/m_async_commands.cpp | 2 | ||||
| -rw-r--r-- | modules/extra/ns_set_misc.cpp | 13 |
8 files changed, 41 insertions, 47 deletions
diff --git a/modules/extra/cs_appendtopic.cpp b/modules/extra/cs_appendtopic.cpp index e46c6654e..97a98e4cc 100644 --- a/modules/extra/cs_appendtopic.cpp +++ b/modules/extra/cs_appendtopic.cpp @@ -60,9 +60,9 @@ class CommandCSAppendTopic : public Command Channel *c = ci->c; if (!c) - u->SendMessage(ChanServ, LanguageString::CHAN_X_NOT_IN_USE, ci->name.c_str()); + source.Reply(_(CHAN_X_NOT_IN_USE), ci->name.c_str()); else if (!check_access(u, ci, CA_TOPIC)) - u->SendMessage(ChanServ, LanguageString::ACCESS_DENIED); + source.Reply(_(ACCESS_DENIED)); else { Anope::string topic; diff --git a/modules/extra/cs_enforce.cpp b/modules/extra/cs_enforce.cpp index 93873fe3c..5e79342a5 100644 --- a/modules/extra/cs_enforce.cpp +++ b/modules/extra/cs_enforce.cpp @@ -89,7 +89,7 @@ class CommandCSEnforce : public Command if (check_access(uc->user, ci, CA_NOJOIN)) { get_idealban(ci, uc->user, mask); - Anope::string reason = GetString(uc->user->Account(), LanguageString::CHAN_NOT_ALLOWED_TO_JOIN); + Anope::string reason = GetString(uc->user->Account(), CHAN_NOT_ALLOWED_TO_JOIN); c->SetMode(NULL, CMODE_BAN, mask); c->Kick(NULL, uc->user, "%s", reason.c_str()); } @@ -113,8 +113,8 @@ class CommandCSEnforce : public Command if (!uc->user->IsIdentified()) { get_idealban(ci, uc->user, mask); - Anope::string reason = GetString(uc->user->Account(), LanguageString::CHAN_NOT_ALLOWED_TO_JOIN); - if (!c->HasMode(CMODE_REGISTERED)) + Anope::string reason = GetString(uc->user->Account(), CHAN_NOT_ALLOWED_TO_JOIN); + if (!c->HasMode(CMODE_REGISTEREDONLY)) c->SetMode(NULL, CMODE_BAN, mask); c->Kick(NULL, uc->user, "%s", reason.c_str()); } @@ -135,9 +135,9 @@ class CommandCSEnforce : public Command Channel *c = ci->c; if (!c) - u->SendMessage(ChanServ, LanguageString::CHAN_X_NOT_IN_USE, ci->name.c_str()); + source.Reply(_(CHAN_X_NOT_IN_USE), ci->name.c_str()); else if (!check_access(u, ci, CA_AKICK)) - u->SendMessage(ChanServ, LanguageString::ACCESS_DENIED); + source.Reply(ACCESS_DENIED); else { if (what.empty() || what.equals_ci("SET")) diff --git a/modules/extra/cs_entrymsg.cpp b/modules/extra/cs_entrymsg.cpp index b6b7fd66d..ad50dbb16 100644 --- a/modules/extra/cs_entrymsg.cpp +++ b/modules/extra/cs_entrymsg.cpp @@ -40,7 +40,7 @@ class CommandEntryMessage : public Command { source.Reply(_("Entry message list for \2%s\2:"), ci->name.c_str()); for (unsigned i = 0; i < messages.size(); ++i) - source.Reply(LanguageString::CHAN_LIST_ENTRY, i + 1, messages[i].message.c_str(), messages[i].creator.c_str(), do_strftime(messages[i].when).c_str()); + source.Reply(_(CHAN_LIST_ENTRY), i + 1, messages[i].message.c_str(), messages[i].creator.c_str(), do_strftime(messages[i].when).c_str()); source.Reply(_("End of entry message list.")); } else @@ -133,7 +133,7 @@ class CommandEntryMessage : public Command } else { - u->SendMessage(ChanServ, LanguageString::ACCESS_DENIED); + source.Reply(_(ACCESS_DENIED)); } return MOD_CONT; diff --git a/modules/extra/cs_set_misc.cpp b/modules/extra/cs_set_misc.cpp index 301112769..1ed2e3c64 100644 --- a/modules/extra/cs_set_misc.cpp +++ b/modules/extra/cs_set_misc.cpp @@ -32,17 +32,17 @@ class CommandCSSetMisc : public Command if (params.size() > 1) { ci->Extend("chanserv:" + this->name, new ExtensibleItemRegular<Anope::string>(params[1])); - u->SendMessage(ChanServ, LanguageString::CHAN_SETTING_CHANGED, this->name.c_str(), ci->name.c_str(), params[1].c_str()); + source.Reply(_(CHAN_SETTING_CHANGED), this->name.c_str(), ci->name.c_str(), params[1].c_str()); } else - u->SendMessage(ChanServ, LanguageString::CHAN_SETTING_UNSET, this->name.c_str(), ci->name.c_str()); + source.Reply(_(CHAN_SETTING_UNSET), this->name.c_str(), ci->name.c_str()); return MOD_CONT; } void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(source, "SET", LanguageString::CHAN_SET_SYNTAX); + SyntaxError(source, "SET", _(CHAN_SET_SYNTAX)); } }; @@ -55,7 +55,7 @@ class CommandCSSASetMisc : public CommandCSSetMisc void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(source, "SASET", LanguageString::CHAN_SASET_SYNTAX); + SyntaxError(source, "SASET", _(CHAN_SASET_SYNTAX)); } }; @@ -160,7 +160,7 @@ class CSSetMisc : public Module } } - void OnChanInfo(User *u, ChannelInfo *ci, bool ShowHidden) + void OnChanInfo(CommandSource &source, ChannelInfo *ci, bool ShowHidden) { for (std::map<Anope::string, CommandInfo *>::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it) { @@ -169,7 +169,7 @@ class CSSetMisc : public Module Anope::string value; if (ci->GetExtRegular("chanserv:" + it->first, value)) - u->SendMessage(ChanServ, " %s: %s", it->first.c_str(), value.c_str()); + source.Reply(" %s: %s", it->first.c_str(), value.c_str()); } } diff --git a/modules/extra/cs_tban.cpp b/modules/extra/cs_tban.cpp index 873a0cfee..8932726d6 100644 --- a/modules/extra/cs_tban.cpp +++ b/modules/extra/cs_tban.cpp @@ -35,16 +35,17 @@ class TempBan : public CallBack } }; -static bool CanBanUser(Channel *c, User *u, User *u2) +static bool CanBanUser(CommandSource &source, Channel *c, User *u2) { + User *u = source.u; ChannelInfo *ci = c->ci; bool ok = false; if (!check_access(u, ci, CA_BAN)) - u->SendMessage(ChanServ, LanguageString::ACCESS_DENIED); + source.Reply(_(ACCESS_DENIED)); else if (matches_list(c, u2, CMODE_EXCEPT)) - u->SendMessage(ChanServ, LanguageString::CHAN_EXCEPTED, u2->nick.c_str(), ci->name.c_str()); + source.Reply(_(CHAN_EXCEPTED), u2->nick.c_str(), ci->name.c_str()); else if (u2->IsProtected()) - u->SendMessage(ChanServ, LanguageString::ACCESS_DENIED); + source.Reply(_(ACCESS_DENIED)); else ok = true; @@ -61,7 +62,6 @@ class CommandCSTBan : public Command CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) { - User *u = source.u; ChannelInfo *ci = source.ci; Channel *c = ci->c; @@ -71,11 +71,11 @@ class CommandCSTBan : public Command User *u2; if (!c) - u->SendMessage(ChanServ, LanguageString::CHAN_X_NOT_IN_USE, chan.c_str()); + source.Reply(_(CHAN_X_NOT_IN_USE), chan.c_str()); else if (!(u2 = finduser(nick))) - u->SendMessage(ChanServ, LanguageString::NICK_X_NOT_IN_USE, nick.c_str()); + source.Reply(_(NICK_X_NOT_IN_USE), nick.c_str()); else - if (CanBanUser(c, u, u2)) + if (CanBanUser(source, c, u2)) { Anope::string mask; get_idealban(c->ci, u2, mask); diff --git a/modules/extra/hs_request.cpp b/modules/extra/hs_request.cpp index 0dd3e707b..9a4eb8644 100644 --- a/modules/extra/hs_request.cpp +++ b/modules/extra/hs_request.cpp @@ -68,19 +68,19 @@ class CommandHSRequest : public Command } if (vIdent.length() > Config->UserLen) { - source.Reply(LanguageString::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)) { - source.Reply(LanguageString::HOST_SET_IDENT_ERROR); + source.Reply(_(HOST_SET_IDENT_ERROR)); return MOD_CONT; } if (!ircd->vident) { - source.Reply(LanguageString::HOST_NO_VIDENT); + source.Reply(_(HOST_NO_VIDENT)); return MOD_CONT; } } @@ -88,13 +88,13 @@ class CommandHSRequest : public Command hostmask = rawhostmask; else { - source.Reply(LanguageString::HOST_SET_TOOLONG, Config->HostLen); + source.Reply(_(HOST_SET_TOOLONG), Config->HostLen); return MOD_CONT; } if (!isValidHost(hostmask, 3)) { - source.Reply(LanguageString::HOST_SET_ERROR); + source.Reply(_(HOST_SET_ERROR)); return MOD_CONT; } @@ -164,7 +164,7 @@ class CommandHSActivate : public Command me->SendMessage(source, _("No request for nick %s found."), nick.c_str()); } else - u->SendMessage(HostServ, LanguageString::NICK_X_NOT_REGISTERED, nick.c_str()); + source.Reply(_(NICK_X_NOT_REGISTERED), nick.c_str()); return MOD_CONT; } @@ -247,7 +247,7 @@ class CommandHSReject : public Command class HSListBase : public Command { protected: - CommandReturn DoList(User *u) + CommandReturn DoList(CommandSource &source) { int counter = 1; int from = 0, to = 0; @@ -260,13 +260,13 @@ class HSListBase : public Command { ++display_counter; if (!hr->ident.empty()) - u->SendMessage(HostServ, _("#%d Nick:\002%s\002, vhost:\002%s\002@\002%s\002 (%s - %s)"), counter, it->first.c_str(), hr->ident.c_str(), hr->host.c_str(), it->first.c_str(), do_strftime(hr->time).c_str()); + source.Reply(_("#%d Nick:\002%s\002, vhost:\002%s\002@\002%s\002 (%s - %s)"), counter, it->first.c_str(), hr->ident.c_str(), hr->host.c_str(), it->first.c_str(), do_strftime(hr->time).c_str()); else - u->SendMessage(HostServ, _("#%d Nick:\002%s\002, vhost:\002%s\002 (%s - %s)"), counter, it->first.c_str(), hr->host.c_str(), it->first.c_str(), do_strftime(hr->time).c_str()); + source.Reply(_("#%d Nick:\002%s\002, vhost:\002%s\002 (%s - %s)"), counter, it->first.c_str(), hr->host.c_str(), it->first.c_str(), do_strftime(hr->time).c_str()); } ++counter; } - u->SendMessage(HostServ, _("Displayed all records (Count: \002%d\002)"), display_counter); + source.Reply(_("Displayed all records (Count: \002%d\002)"), display_counter); return MOD_CONT; } @@ -274,11 +274,6 @@ class HSListBase : public Command HSListBase(const Anope::string &cmd, int min, int max) : Command(cmd, min, max, "hostserv/set") { } - - void OnSyntaxError(CommandSource &source, const Anope::string &subcommand) - { - // no-op - } }; class CommandHSWaiting : public HSListBase @@ -291,7 +286,7 @@ class CommandHSWaiting : public HSListBase CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) { - return this->DoList(source.u); + return this->DoList(source); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) diff --git a/modules/extra/m_async_commands.cpp b/modules/extra/m_async_commands.cpp index b97be4788..d4bbaaf6d 100644 --- a/modules/extra/m_async_commands.cpp +++ b/modules/extra/m_async_commands.cpp @@ -45,7 +45,7 @@ class AsynchCommandMutex : public CommandMutex if (!command->permission.empty() && !u->Account()->HasCommand(command->permission)) { - u->SendMessage(bi, LanguageString::ACCESS_DENIED); + u->SendMessage(bi, _(ACCESS_DENIED)); Log(LOG_COMMAND, "denied", bi) << "Access denied for user " << u->GetMask() << " with command " << command; } else diff --git a/modules/extra/ns_set_misc.cpp b/modules/extra/ns_set_misc.cpp index 767077e53..a1bf091c5 100644 --- a/modules/extra/ns_set_misc.cpp +++ b/modules/extra/ns_set_misc.cpp @@ -26,7 +26,6 @@ class CommandNSSetMisc : public Command CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) { - User *u = source.u; NickAlias *na = findnick(params[0]); if (!na) throw CoreException("NULL na in CommandNSSetMisc"); @@ -36,17 +35,17 @@ class CommandNSSetMisc : public Command if (params.size() > 1) { nc->Extend("nickserv:" + this->name, new ExtensibleItemRegular<Anope::string>(params[1])); - u->SendMessage(NickServ, LanguageString::CHAN_SETTING_CHANGED, this->name.c_str(), nc->display.c_str(), params[1].c_str()); + source.Reply(_(CHAN_SETTING_CHANGED), this->name.c_str(), nc->display.c_str(), params[1].c_str()); } else - u->SendMessage(NickServ, LanguageString::CHAN_SETTING_UNSET, this->name.c_str(), nc->display.c_str()); + source.Reply(_(CHAN_SETTING_UNSET), this->name.c_str(), nc->display.c_str()); return MOD_CONT; } void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(source, "SET", LanguageString::NICK_SET_SYNTAX); + SyntaxError(source, "SET", _(NICK_SET_SYNTAX)); } }; @@ -59,7 +58,7 @@ class CommandNSSASetMisc : public CommandNSSetMisc void OnSyntaxError(CommandSource &source, const Anope::string &) { - SyntaxError(source, "SASET", LanguageString::NICK_SASET_SYNTAX); + SyntaxError(source, "SASET", _(NICK_SASET_SYNTAX)); } }; @@ -163,7 +162,7 @@ class NSSetMisc : public Module } } - void OnNickInfo(User *u, NickAlias *na, bool ShowHidden) + void OnNickInfo(CommandSource &source, NickAlias *na, bool ShowHidden) { for (std::map<Anope::string, CommandInfo *>::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it) { @@ -172,7 +171,7 @@ class NSSetMisc : public Module Anope::string value; if (na->nc->GetExtRegular("nickserv:" + it->first, value)) - u->SendMessage(NickServ, " %s: %s", it->first.c_str(), value.c_str()); + source.Reply(" %s: %s", it->first.c_str(), value.c_str()); } } |
