From d646d455e2655be59f6d5bcc56710ac70548ca37 Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 26 Sep 2010 02:33:01 -0400 Subject: Changed the language system to use gettext --- modules/core/bs_act.cpp | 12 +-- modules/core/bs_assign.cpp | 18 ++-- modules/core/bs_badwords.cpp | 40 ++++----- modules/core/bs_bot.cpp | 74 ++++++++--------- modules/core/bs_botlist.cpp | 14 ++-- modules/core/bs_help.cpp | 4 +- modules/core/bs_info.cpp | 101 +++++++++++----------- modules/core/bs_kick.cpp | 108 ++++++++++++------------ modules/core/bs_say.cpp | 12 +-- modules/core/bs_set.cpp | 74 ++++++++--------- modules/core/bs_unassign.cpp | 16 ++-- modules/core/cs_access.cpp | 152 ++++++++++++++++++---------------- modules/core/cs_akick.cpp | 96 ++++++++++----------- modules/core/cs_ban.cpp | 18 ++-- modules/core/cs_clear.cpp | 24 +++--- modules/core/cs_drop.cpp | 18 ++-- modules/core/cs_forbid.cpp | 18 ++-- modules/core/cs_getkey.cpp | 12 +-- modules/core/cs_help.cpp | 25 +----- modules/core/cs_info.cpp | 81 ++++++++---------- modules/core/cs_invite.cpp | 18 ++-- modules/core/cs_kick.cpp | 18 ++-- modules/core/cs_list.cpp | 28 +++---- modules/core/cs_modes.cpp | 72 ++++++++-------- modules/core/cs_register.cpp | 27 +++--- modules/core/cs_saset.cpp | 14 ++-- modules/core/cs_saset_noexpire.cpp | 10 +-- modules/core/cs_set.cpp | 16 ++-- modules/core/cs_set_bantype.cpp | 14 ++-- modules/core/cs_set_description.cpp | 12 +-- modules/core/cs_set_entrymsg.cpp | 14 ++-- modules/core/cs_set_founder.cpp | 20 ++--- modules/core/cs_set_keeptopic.cpp | 14 ++-- modules/core/cs_set_mlock.cpp | 20 ++--- modules/core/cs_set_opnotice.cpp | 14 ++-- modules/core/cs_set_peace.cpp | 14 ++-- modules/core/cs_set_persist.cpp | 14 ++-- modules/core/cs_set_private.cpp | 14 ++-- modules/core/cs_set_restricted.cpp | 14 ++-- modules/core/cs_set_secure.cpp | 14 ++-- modules/core/cs_set_securefounder.cpp | 16 ++-- modules/core/cs_set_secureops.cpp | 14 ++-- modules/core/cs_set_signkick.cpp | 16 ++-- modules/core/cs_set_successor.cpp | 22 ++--- modules/core/cs_set_topiclock.cpp | 14 ++-- modules/core/cs_set_xop.cpp | 16 ++-- modules/core/cs_status.cpp | 12 +-- modules/core/cs_suspend.cpp | 34 ++++---- modules/core/cs_topic.cpp | 10 +-- modules/core/cs_unban.cpp | 16 ++-- modules/core/cs_xop.cpp | 110 ++++++++++++------------ modules/core/db_plain.cpp | 37 +-------- modules/core/hs_del.cpp | 12 +-- modules/core/hs_delall.cpp | 12 +-- modules/core/hs_group.cpp | 10 +-- modules/core/hs_help.cpp | 2 +- modules/core/hs_list.cpp | 30 +++---- modules/core/hs_off.cpp | 8 +- modules/core/hs_on.cpp | 10 +-- modules/core/hs_set.cpp | 26 +++--- modules/core/hs_setall.cpp | 26 +++--- modules/core/ms_cancel.cpp | 14 ++-- modules/core/ms_check.cpp | 21 ++--- modules/core/ms_del.cpp | 22 ++--- modules/core/ms_help.cpp | 4 +- modules/core/ms_info.cpp | 80 +++++++++--------- modules/core/ms_list.cpp | 36 ++++---- modules/core/ms_read.cpp | 28 +++---- modules/core/ms_rsend.cpp | 12 +-- modules/core/ms_send.cpp | 6 +- modules/core/ms_sendall.cpp | 10 +-- modules/core/ms_set.cpp | 70 ++++++++-------- modules/core/ms_staff.cpp | 8 +- modules/core/ns_access.cpp | 34 ++++---- modules/core/ns_alist.cpp | 20 ++--- modules/core/ns_drop.cpp | 26 +++--- modules/core/ns_forbid.cpp | 18 ++-- modules/core/ns_getemail.cpp | 10 +-- modules/core/ns_getpass.cpp | 18 ++-- modules/core/ns_ghost.cpp | 24 +++--- modules/core/ns_group.cpp | 77 ++++++++--------- modules/core/ns_help.cpp | 21 ++--- modules/core/ns_identify.cpp | 26 +++--- modules/core/ns_info.cpp | 77 +++++++---------- modules/core/ns_list.cpp | 24 +++--- modules/core/ns_logout.cpp | 16 ++-- modules/core/ns_recover.cpp | 28 +++---- modules/core/ns_register.cpp | 74 ++++++++--------- modules/core/ns_release.cpp | 23 +++-- modules/core/ns_resetpass.cpp | 26 +++--- modules/core/ns_saset.cpp | 46 +++++----- modules/core/ns_saset_noexpire.cpp | 10 +-- modules/core/ns_sendpass.cpp | 22 ++--- modules/core/ns_set.cpp | 40 ++++----- modules/core/ns_set_autoop.cpp | 16 ++-- modules/core/ns_set_email.cpp | 18 ++-- modules/core/ns_set_greet.cpp | 12 +-- modules/core/ns_set_hide.cpp | 18 ++-- modules/core/ns_set_kill.cpp | 22 ++--- modules/core/ns_set_language.cpp | 43 ++++++---- modules/core/ns_set_message.cpp | 18 ++-- modules/core/ns_set_private.cpp | 16 ++-- modules/core/ns_set_secure.cpp | 16 ++-- modules/core/ns_status.cpp | 14 ++-- modules/core/ns_suspend.cpp | 32 +++---- modules/core/ns_update.cpp | 6 +- modules/core/os_akill.cpp | 61 ++++++-------- modules/core/os_chankill.cpp | 10 +-- modules/core/os_chanlist.cpp | 14 ++-- modules/core/os_clearmodes.cpp | 14 ++-- modules/core/os_defcon.cpp | 49 ++++++----- modules/core/os_global.cpp | 6 +- modules/core/os_help.cpp | 4 +- modules/core/os_ignore.cpp | 22 ++--- modules/core/os_jupe.cpp | 10 +-- modules/core/os_kick.cpp | 12 +-- modules/core/os_mode.cpp | 10 +-- modules/core/os_modinfo.cpp | 16 ++-- modules/core/os_modlist.cpp | 26 +++--- modules/core/os_modload.cpp | 10 +-- modules/core/os_modunload.cpp | 10 +-- modules/core/os_news.cpp | 76 +++++++---------- modules/core/os_noop.cpp | 10 +-- modules/core/os_oline.cpp | 14 ++-- modules/core/os_quit.cpp | 4 +- modules/core/os_reload.cpp | 6 +- modules/core/os_restart.cpp | 4 +- modules/core/os_session.cpp | 81 +++++++++--------- modules/core/os_set.cpp | 68 +++++++-------- modules/core/os_shutdown.cpp | 4 +- modules/core/os_snline.cpp | 57 ++++++------- modules/core/os_sqline.cpp | 57 ++++++------- modules/core/os_staff.cpp | 14 ++-- modules/core/os_stats.cpp | 147 ++++++++++++++------------------ modules/core/os_svsnick.cpp | 20 ++--- modules/core/os_szline.cpp | 55 ++++++------ modules/core/os_umode.cpp | 12 +-- modules/core/os_update.cpp | 6 +- modules/core/os_userlist.cpp | 14 ++-- 139 files changed, 1840 insertions(+), 2036 deletions(-) (limited to 'modules/core') diff --git a/modules/core/bs_act.cpp b/modules/core/bs_act.cpp index a3487a0ab..b575f5030 100644 --- a/modules/core/bs_act.cpp +++ b/modules/core/bs_act.cpp @@ -27,19 +27,19 @@ class CommandBSAct : public Command if (!check_access(u, ci, CA_SAY)) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } if (!ci->bi) { - notice_help(Config->s_BotServ, u, BOT_NOT_ASSIGNED); + u->SendMessage(BotServ, BOT_NOT_ASSIGNED); return MOD_CONT; } if (!ci->c || !ci->c->FindUser(ci->bi)) { - notice_lang(Config->s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name.c_str()); + u->SendMessage(BotServ, BOT_NOT_ON_CHANNEL, ci->name.c_str()); return MOD_CONT; } @@ -58,18 +58,18 @@ class CommandBSAct : public Command void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "ACT", BOT_ACT_SYNTAX); + SyntaxError(BotServ, u, "ACT", BOT_ACT_SYNTAX); } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config->s_BotServ, u, BOT_HELP_ACT); + u->SendMessage(BotServ, BOT_HELP_ACT); return true; } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_ACT); + u->SendMessage(BotServ, BOT_HELP_CMD_ACT); } }; diff --git a/modules/core/bs_assign.cpp b/modules/core/bs_assign.cpp index 97b23c0ef..c328c2f51 100644 --- a/modules/core/bs_assign.cpp +++ b/modules/core/bs_assign.cpp @@ -29,13 +29,13 @@ class CommandBSAssign : public Command if (readonly) { - notice_lang(Config->s_BotServ, u, BOT_ASSIGN_READONLY); + u->SendMessage(BotServ, BOT_ASSIGN_READONLY); return MOD_CONT; } if (!(bi = findbot(nick))) { - notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); + u->SendMessage(BotServ, BOT_DOES_NOT_EXIST, nick.c_str()); return MOD_CONT; } @@ -43,19 +43,19 @@ class CommandBSAssign : public Command if (ci->botflags.HasFlag(BS_NOBOT) || (!check_access(u, ci, CA_ASSIGN) && !u->Account()->HasPriv("botserv/administration"))) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } if (bi->HasFlag(BI_PRIVATE) && !u->Account()->HasCommand("botserv/assign/private")) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } if (ci->bi && nick.equals_ci(ci->bi->nick)) { - notice_lang(Config->s_BotServ, u, BOT_ASSIGN_ALREADY, ci->bi->nick.c_str(), chan.c_str()); + u->SendMessage(BotServ, BOT_ASSIGN_ALREADY, ci->bi->nick.c_str(), chan.c_str()); return MOD_CONT; } @@ -63,24 +63,24 @@ class CommandBSAssign : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "for " << bi->nick; bi->Assign(u, ci); - notice_lang(Config->s_BotServ, u, BOT_ASSIGN_ASSIGNED, bi->nick.c_str(), ci->name.c_str()); + u->SendMessage(BotServ, BOT_ASSIGN_ASSIGNED, bi->nick.c_str(), ci->name.c_str()); return MOD_CONT; } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config->s_BotServ, u, BOT_HELP_ASSIGN); + u->SendMessage(BotServ, BOT_HELP_ASSIGN); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX); + SyntaxError(BotServ, u, "ASSIGN", BOT_ASSIGN_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_ASSIGN); + u->SendMessage(BotServ, BOT_HELP_CMD_ASSIGN); } }; diff --git a/modules/core/bs_badwords.cpp b/modules/core/bs_badwords.cpp index c02ff6570..52da7d777 100644 --- a/modules/core/bs_badwords.cpp +++ b/modules/core/bs_badwords.cpp @@ -26,7 +26,7 @@ class BadwordsListCallback : public NumberList ~BadwordsListCallback() { if (!SentHeader) - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); } void HandleNumber(unsigned Number) @@ -37,7 +37,7 @@ class BadwordsListCallback : public NumberList if (!SentHeader) { SentHeader = true; - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); } DoList(u, ci, Number - 1, ci->GetBadWord(Number - 1)); @@ -45,7 +45,7 @@ class BadwordsListCallback : public NumberList static void DoList(User *u, ChannelInfo *ci, unsigned Number, BadWord *bw) { - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_FORMAT, Number + 1, bw->word.c_str(), bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : ""))); + u->SendMessage(BotServ, BOT_BADWORDS_LIST_FORMAT, Number + 1, bw->word.c_str(), bw->type == BW_SINGLE ? "(SINGLE)" : (bw->type == BW_START ? "(START)" : (bw->type == BW_END ? "(END)" : ""))); } }; @@ -66,11 +66,11 @@ class BadwordsDelCallback : public NumberList ~BadwordsDelCallback() { if (!Deleted) - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); else if (Deleted == 1) - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DELETED_ONE, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_DELETED_ONE, ci->name.c_str()); else - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DELETED_SEVERAL, Deleted, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_DELETED_SEVERAL, Deleted, ci->name.c_str()); } void HandleNumber(unsigned Number) @@ -93,7 +93,7 @@ class CommandBSBadwords : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "LIST"; if (!ci->GetBadWordCount()) - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_EMPTY, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_LIST_EMPTY, ci->name.c_str()); else if (!word.empty() && word.find_first_not_of("1234567890,-") == Anope::string::npos) { BadwordsListCallback list(u, ci, word); @@ -113,14 +113,14 @@ class CommandBSBadwords : public Command if (!SentHeader) { SentHeader = true; - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_LIST_HEADER, ci->name.c_str()); } BadwordsListCallback::DoList(u, ci, i, bw); } if (!SentHeader) - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_NO_MATCH, ci->name.c_str()); } return MOD_CONT; @@ -149,7 +149,7 @@ class CommandBSBadwords : public Command if (ci->GetBadWordCount() >= Config->BSBadWordsMax) { - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_REACHED_LIMIT, Config->BSBadWordsMax); + u->SendMessage(BotServ, BOT_BADWORDS_REACHED_LIMIT, Config->BSBadWordsMax); return MOD_CONT; } @@ -159,7 +159,7 @@ class CommandBSBadwords : public Command if (!bw->word.empty() && ((Config->BSCaseSensitive && realword.equals_cs(bw->word)) || (!Config->BSCaseSensitive && realword.equals_ci(bw->word)))) { - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_ALREADY_EXISTS, bw->word.c_str(), ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_ALREADY_EXISTS, bw->word.c_str(), ci->name.c_str()); return MOD_CONT; } } @@ -168,7 +168,7 @@ class CommandBSBadwords : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "ADD " << realword; ci->AddBadWord(realword, type); - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_ADDED, realword.c_str(), ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_ADDED, realword.c_str(), ci->name.c_str()); return MOD_CONT; } @@ -196,7 +196,7 @@ class CommandBSBadwords : public Command if (i == end) { - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_NOT_FOUND, word.c_str(), ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_NOT_FOUND, word.c_str(), ci->name.c_str()); return MOD_CONT; } @@ -204,7 +204,7 @@ class CommandBSBadwords : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "DEL " << badword->word; ci->EraseBadWord(i); - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name.c_str()); + u->SendMessage(BotServ, BOT_BADWORDS_DELETED, badword->word.c_str(), ci->name.c_str()); } return MOD_CONT; @@ -216,7 +216,7 @@ class CommandBSBadwords : public Command Log(override ? LOG_OVERRIDE : LOG_COMMAND, u, this, ci) << "CLEAR"; ci->ClearBadWords(); - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_CLEAR); + u->SendMessage(BotServ, BOT_BADWORDS_CLEAR); return MOD_CONT; } public: @@ -242,13 +242,13 @@ class CommandBSBadwords : public Command if (!check_access(u, ci, CA_BADWORDS) && (!need_args || !u->Account()->HasPriv("botserv/administration"))) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } if (readonly) { - notice_lang(Config->s_BotServ, u, BOT_BADWORDS_DISABLED); + u->SendMessage(BotServ, BOT_BADWORDS_DISABLED); return MOD_CONT; } @@ -268,18 +268,18 @@ class CommandBSBadwords : public Command bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config->s_BotServ, u, BOT_HELP_BADWORDS); + u->SendMessage(BotServ, BOT_HELP_BADWORDS); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX); + SyntaxError(BotServ, u, "BADWORDS", BOT_BADWORDS_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_BADWORDS); + u->SendMessage(BotServ, BOT_HELP_CMD_BADWORDS); } }; diff --git a/modules/core/bs_bot.cpp b/modules/core/bs_bot.cpp index 7054ed479..067633964 100644 --- a/modules/core/bs_bot.cpp +++ b/modules/core/bs_bot.cpp @@ -26,60 +26,60 @@ class CommandBSBot : public Command if (findbot(nick)) { - notice_lang(Config->s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick.c_str()); + u->SendMessage(BotServ, BOT_BOT_ALREADY_EXISTS, nick.c_str()); return MOD_CONT; } if (nick.length() > Config->NickLen) { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } if (user.length() > Config->UserLen) { - notice_lang(Config->s_BotServ, u, BOT_LONG_IDENT, Config->UserLen); + u->SendMessage(BotServ, BOT_LONG_IDENT, Config->UserLen); return MOD_CONT; } if (host.length() > Config->HostLen) { - notice_lang(Config->s_BotServ, u, BOT_LONG_HOST, Config->HostLen); + u->SendMessage(BotServ, BOT_LONG_HOST, Config->HostLen); return MOD_CONT; } /* Check the nick is valid re RFC 2812 */ if (isdigit(nick[0]) || nick[0] == '-') { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i) if (!isvalidnick(nick[i])) { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } /* check for hardcored ircd forbidden nicks */ if (!ircdproto->IsNickValid(nick)) { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } /* Check the host is valid re RFC 2812 */ if (!isValidHost(host, 3)) { - notice_lang(Config->s_BotServ, u, BOT_BAD_HOST); + u->SendMessage(BotServ, BOT_BAD_HOST); return MOD_CONT; } for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i) if (!isalnum(user[i])) { - notice_lang(Config->s_BotServ, u, BOT_BAD_IDENT, Config->UserLen); + u->SendMessage(BotServ, BOT_BAD_IDENT, Config->UserLen); return MOD_CONT; } @@ -89,20 +89,20 @@ class CommandBSBot : public Command */ if (findnick(nick)) { - notice_lang(Config->s_BotServ, u, NICK_ALREADY_REGISTERED, nick.c_str()); + u->SendMessage(BotServ, NICK_ALREADY_REGISTERED, nick.c_str()); return MOD_CONT; } if (!(bi = new BotInfo(nick, user, host, real))) { // XXX this cant happen? - notice_lang(Config->s_BotServ, u, BOT_BOT_CREATION_FAILED); + u->SendMessage(BotServ, BOT_BOT_CREATION_FAILED); return MOD_CONT; } Log(LOG_ADMIN, u, this) << "ADD " << bi->GetMask() << " " << bi->realname; - notice_lang(Config->s_BotServ, u, BOT_BOT_ADDED, bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); + u->SendMessage(BotServ, BOT_BOT_ADDED, bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); FOREACH_MOD(I_OnBotCreate, OnBotCreate(bi)); return MOD_CONT; @@ -125,37 +125,37 @@ class CommandBSBot : public Command if (!(bi = findbot(oldnick))) { - notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); + u->SendMessage(BotServ, BOT_DOES_NOT_EXIST, oldnick.c_str()); return MOD_CONT; } if (!oldnick.equals_ci(nick) && nickIsServices(oldnick, false)) { - notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); + u->SendMessage(BotServ, BOT_DOES_NOT_EXIST, oldnick.c_str()); return MOD_CONT; } if (nick.length() > Config->NickLen) { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } if (!user.empty() && user.length() > Config->UserLen) { - notice_lang(Config->s_BotServ, u, BOT_LONG_IDENT, Config->UserLen); + u->SendMessage(BotServ, BOT_LONG_IDENT, Config->UserLen); return MOD_CONT; } if (!host.empty() && host.length() > Config->HostLen) { - notice_lang(Config->s_BotServ, u, BOT_LONG_HOST, Config->HostLen); + u->SendMessage(BotServ, BOT_LONG_HOST, Config->HostLen); return MOD_CONT; } if (!oldnick.equals_ci(nick) && nickIsServices(nick, false)) { - notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, oldnick.c_str()); + u->SendMessage(BotServ, BOT_DOES_NOT_EXIST, oldnick.c_str()); return MOD_CONT; } @@ -166,34 +166,34 @@ class CommandBSBot : public Command */ if (nick.equals_cs(bi->nick) && (!user.empty() ? user.equals_cs(bi->GetIdent()) : 1) && (!host.empty() ? host.equals_cs(bi->host) : 1) && (!real.empty() ? real.equals_cs(bi->realname) : 1)) { - notice_lang(Config->s_BotServ, u, BOT_BOT_ANY_CHANGES); + u->SendMessage(BotServ, BOT_BOT_ANY_CHANGES); return MOD_CONT; } /* Check the nick is valid re RFC 2812 */ if (isdigit(nick[0]) || nick[0] == '-') { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } for (unsigned i = 0, end = nick.length(); i < end && i < Config->NickLen; ++i) if (!isvalidnick(nick[i])) { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } /* check for hardcored ircd forbidden nicks */ if (!ircdproto->IsNickValid(nick)) { - notice_lang(Config->s_BotServ, u, BOT_BAD_NICK); + u->SendMessage(BotServ, BOT_BAD_NICK); return MOD_CONT; } if (!host.empty() && !isValidHost(host, 3)) { - notice_lang(Config->s_BotServ, u, BOT_BAD_HOST); + u->SendMessage(BotServ, BOT_BAD_HOST); return MOD_CONT; } @@ -201,13 +201,13 @@ class CommandBSBot : public Command for (unsigned i = 0, end = user.length(); i < end && i < Config->UserLen; ++i) if (!isalnum(user[i])) { - notice_lang(Config->s_BotServ, u, BOT_BAD_IDENT, Config->UserLen); + u->SendMessage(BotServ, BOT_BAD_IDENT, Config->UserLen); return MOD_CONT; } if (!nick.equals_ci(bi->nick) && findbot(nick)) { - notice_lang(Config->s_BotServ, u, BOT_BOT_ALREADY_EXISTS, nick.c_str()); + u->SendMessage(BotServ, BOT_BOT_ALREADY_EXISTS, nick.c_str()); return MOD_CONT; } @@ -219,7 +219,7 @@ class CommandBSBot : public Command */ if (findnick(nick)) { - notice_lang(Config->s_BotServ, u, NICK_ALREADY_REGISTERED, nick.c_str()); + u->SendMessage(BotServ, NICK_ALREADY_REGISTERED, nick.c_str()); return MOD_CONT; } @@ -262,7 +262,7 @@ class CommandBSBot : public Command bi->RejoinAll(); } - notice_lang(Config->s_BotServ, u, BOT_BOT_CHANGED, oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); + u->SendMessage(BotServ, BOT_BOT_CHANGED, oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str()); Log(LOG_ADMIN, u, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname; FOREACH_MOD(I_OnBotChange, OnBotChange(bi)); @@ -282,13 +282,13 @@ class CommandBSBot : public Command if (!(bi = findbot(nick))) { - notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); + u->SendMessage(BotServ, BOT_DOES_NOT_EXIST, nick.c_str()); return MOD_CONT; } if (nickIsServices(nick, false)) { - notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, nick.c_str()); + u->SendMessage(BotServ, BOT_DOES_NOT_EXIST, nick.c_str()); return MOD_CONT; } @@ -301,7 +301,7 @@ class CommandBSBot : public Command Log(LOG_ADMIN, u, this) << "DEL " << bi->nick; delete bi; - notice_lang(Config->s_BotServ, u, BOT_BOT_DELETED, nick.c_str()); + u->SendMessage(BotServ, BOT_BOT_DELETED, nick.c_str()); return MOD_CONT; } public: @@ -316,7 +316,7 @@ class CommandBSBot : public Command if (readonly) { - notice_lang(Config->s_BotServ, u, BOT_BOT_READONLY); + u->SendMessage(BotServ, BOT_BOT_READONLY); return MOD_CONT; } @@ -325,7 +325,7 @@ class CommandBSBot : public Command // ADD nick user host real - 5 if (!u->Account()->HasCommand("botserv/bot/add")) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } @@ -348,7 +348,7 @@ class CommandBSBot : public Command // but only oldn and newn are required if (!u->Account()->HasCommand("botserv/bot/change")) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } @@ -365,7 +365,7 @@ class CommandBSBot : public Command // DEL nick if (!u->Account()->HasCommand("botserv/bot/del")) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } @@ -385,18 +385,18 @@ class CommandBSBot : public Command bool OnHelp(User *u, const Anope::string &subcommand) { - notice_lang(Config->s_BotServ, u, BOT_SERVADMIN_HELP_BOT); + u->SendMessage(BotServ, BOT_SERVADMIN_HELP_BOT); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "BOT", BOT_BOT_SYNTAX); + SyntaxError(BotServ, u, "BOT", BOT_BOT_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_BOT); + u->SendMessage(BotServ, BOT_HELP_CMD_BOT); } }; diff --git a/modules/core/bs_botlist.cpp b/modules/core/bs_botlist.cpp index 3234027ed..425cf48ab 100644 --- a/modules/core/bs_botlist.cpp +++ b/modules/core/bs_botlist.cpp @@ -26,7 +26,7 @@ class CommandBSBotList : public Command if (BotListByNick.empty()) { - notice_lang(Config->s_BotServ, u, BOT_BOTLIST_EMPTY); + u->SendMessage(BotServ, BOT_BOTLIST_EMPTY); return MOD_CONT; } @@ -37,7 +37,7 @@ class CommandBSBotList : public Command if (!bi->HasFlag(BI_PRIVATE)) { if (!count) - notice_lang(Config->s_BotServ, u, BOT_BOTLIST_HEADER); + u->SendMessage(BotServ, BOT_BOTLIST_HEADER); ++count; u->SendMessage(Config->s_BotServ, " %-15s (%s@%s)", bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str()); } @@ -45,7 +45,7 @@ class CommandBSBotList : public Command if (u->Account()->HasCommand("botserv/botlist") && count < BotListByNick.size()) { - notice_lang(Config->s_BotServ, u, BOT_BOTLIST_PRIVATE_HEADER); + u->SendMessage(BotServ, BOT_BOTLIST_PRIVATE_HEADER); for (botinfo_map::const_iterator it = BotListByNick.begin(), it_end = BotListByNick.end(); it != it_end; ++it) { @@ -60,22 +60,22 @@ class CommandBSBotList : public Command } if (!count) - notice_lang(Config->s_BotServ, u, BOT_BOTLIST_EMPTY); + u->SendMessage(BotServ, BOT_BOTLIST_EMPTY); else - notice_lang(Config->s_BotServ, u, BOT_BOTLIST_FOOTER, count); + u->SendMessage(BotServ, BOT_BOTLIST_FOOTER, count); return MOD_CONT; } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config->s_BotServ, u, BOT_HELP_BOTLIST); + u->SendMessage(BotServ, BOT_HELP_BOTLIST); return true; } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_BOTLIST); + u->SendMessage(BotServ, BOT_HELP_CMD_BOTLIST); } }; diff --git a/modules/core/bs_help.cpp b/modules/core/bs_help.cpp index 9faeae9cf..fec543417 100644 --- a/modules/core/bs_help.cpp +++ b/modules/core/bs_help.cpp @@ -31,11 +31,11 @@ class CommandBSHelp : public Command void OnSyntaxError(User *u, const Anope::string &subcommand) { // Abuse syntax error to display general list help. - notice_help(Config->s_BotServ, u, BOT_HELP); + u->SendMessage(BotServ, BOT_HELP); for (CommandMap::const_iterator it = BotServ->Commands.begin(), it_end = BotServ->Commands.end(); it != it_end; ++it) if (!Config->HidePrivilegedCommands || it->second->permission.empty() || (u->Account() && u->Account()->HasCommand(it->second->permission))) it->second->OnServHelp(u); - notice_help(Config->s_BotServ, u, BOT_HELP_FOOTER, Config->BSMinUsers); + u->SendMessage(BotServ, BOT_HELP_FOOTER, Config->BSMinUsers); } }; diff --git a/modules/core/bs_info.cpp b/modules/core/bs_info.cpp index 214ed6e3a..2cb3475d8 100644 --- a/modules/core/bs_info.cpp +++ b/modules/core/bs_info.cpp @@ -53,20 +53,15 @@ class CommandBSInfo : public Command int need_comma = 0; char buf[BUFSIZE], *end; - const char *commastr = getstring(u, COMMA_SPACE); if ((bi = findbot(query))) { - struct tm *tm; - - notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_HEADER, bi->nick.c_str()); - notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_MASK, bi->GetIdent().c_str(), bi->host.c_str()); - notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_REALNAME, bi->realname.c_str()); - tm = localtime(&bi->created); - strftime_lang(buf, sizeof(buf), u, STRFTIME_DATE_TIME_FORMAT, tm); - notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_CREATED, buf); - notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_OPTIONS, getstring(u, (bi->HasFlag(BI_PRIVATE) ? BOT_INFO_OPT_PRIVATE : BOT_INFO_OPT_NONE))); - notice_lang(Config->s_BotServ, u, BOT_INFO_BOT_USAGE, bi->chancount); + u->SendMessage(BotServ, BOT_INFO_BOT_HEADER, bi->nick.c_str()); + u->SendMessage(BotServ, BOT_INFO_BOT_MASK, bi->GetIdent().c_str(), bi->host.c_str()); + u->SendMessage(BotServ, BOT_INFO_BOT_REALNAME, bi->realname.c_str()); + u->SendMessage(BotServ, BOT_INFO_BOT_CREATED, do_strftime(bi->created).c_str()); + u->SendMessage(BotServ, BOT_INFO_BOT_OPTIONS, GetString(u, (bi->HasFlag(BI_PRIVATE) ? NICK_INFO_OPT_PRIVATE : NICK_INFO_OPT_NONE)).c_str()); + u->SendMessage(BotServ, BOT_INFO_BOT_USAGE, bi->chancount); if (u->Account()->HasPriv("botserv/administration")) this->send_bot_channels(u, bi); @@ -75,151 +70,151 @@ class CommandBSInfo : public Command { if (!check_access(u, ci, CA_FOUNDER) && !u->Account()->HasPriv("botserv/administration")) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_HEADER, ci->name.c_str()); + u->SendMessage(BotServ, CHAN_INFO_HEADER, ci->name.c_str()); if (ci->bi) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_BOT, ci->bi->nick.c_str()); + u->SendMessage(BotServ, BOT_INFO_CHAN_BOT, ci->bi->nick.c_str()); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_BOT_NONE); + u->SendMessage(BotServ, BOT_INFO_CHAN_BOT_NONE); if (ci->botflags.HasFlag(BS_KICK_BADWORDS)) { if (ci->ttb[TTB_BADWORDS]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BADWORDS]); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_BADWORDS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_BADWORDS]); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, getstring(u, BOT_INFO_ACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_BADWORDS, GetString(u, BOT_INFO_ACTIVE).c_str()); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BADWORDS, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_BADWORDS, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_BOLDS)) { if (ci->ttb[TTB_BOLDS]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_BOLDS]); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_BOLDS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_BOLDS]); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, getstring(u, BOT_INFO_ACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_BOLDS, GetString(u, BOT_INFO_ACTIVE).c_str()); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_BOLDS, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_BOLDS, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_CAPS)) { if (ci->ttb[TTB_CAPS]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_CAPS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_CAPS], ci->capsmin, ci->capspercent); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_ON, getstring(u, BOT_INFO_ACTIVE), ci->capsmin, ci->capspercent); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_CAPS_ON, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->capsmin, ci->capspercent); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_CAPS_OFF, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_CAPS_OFF, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_COLORS)) { if (ci->ttb[TTB_COLORS]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_COLORS]); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_COLORS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_COLORS]); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, getstring(u, BOT_INFO_ACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_COLORS, GetString(u, BOT_INFO_ACTIVE).c_str()); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_COLORS, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_COLORS, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_FLOOD)) { if (ci->ttb[TTB_FLOOD]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_FLOOD_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_FLOOD], ci->floodlines, ci->floodsecs); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_ON, getstring(u, BOT_INFO_ACTIVE), ci->floodlines, ci->floodsecs); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_FLOOD_ON, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->floodlines, ci->floodsecs); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_FLOOD_OFF, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_FLOOD_OFF, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_REPEAT)) { if (ci->ttb[TTB_REPEAT]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REPEAT], ci->repeattimes); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_REPEAT_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_REPEAT], ci->repeattimes); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_ON, getstring(u, BOT_INFO_ACTIVE), ci->repeattimes); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_REPEAT_ON, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->repeattimes); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REPEAT_OFF, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_REPEAT_OFF, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_REVERSES)) { if (ci->ttb[TTB_REVERSES]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_REVERSES]); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_REVERSES_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_REVERSES]); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, getstring(u, BOT_INFO_ACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_REVERSES, GetString(u, BOT_INFO_ACTIVE).c_str()); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_REVERSES, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_REVERSES, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_UNDERLINES)) { if (ci->ttb[TTB_UNDERLINES]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_UNDERLINES]); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_UNDERLINES_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_UNDERLINES]); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_ACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_UNDERLINES, GetString(u, BOT_INFO_ACTIVE).c_str()); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_UNDERLINES, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_UNDERLINES, GetString(u, BOT_INFO_INACTIVE).c_str()); if (ci->botflags.HasFlag(BS_KICK_ITALICS)) { if (ci->ttb[TTB_ITALICS]) - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS_BAN, getstring(u, BOT_INFO_ACTIVE), ci->ttb[TTB_ITALICS]); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_ITALICS_BAN, GetString(u, BOT_INFO_ACTIVE).c_str(), ci->ttb[TTB_ITALICS]); else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_ACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_ITALICS, GetString(u, BOT_INFO_ACTIVE).c_str()); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_KICK_ITALICS, getstring(u, BOT_INFO_INACTIVE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_KICK_ITALICS, GetString(u, BOT_INFO_INACTIVE).c_str()); end = buf; *end = 0; if (ci->botflags.HasFlag(BS_DONTKICKOPS)) { - end += snprintf(end, sizeof(buf) - (end - buf), "%s", getstring(u, BOT_INFO_OPT_DONTKICKOPS)); + end += snprintf(end, sizeof(buf) - (end - buf), "%s", GetString(u, BOT_INFO_OPT_DONTKICKOPS).c_str()); need_comma = 1; } if (ci->botflags.HasFlag(BS_DONTKICKVOICES)) { - end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", getstring(u, BOT_INFO_OPT_DONTKICKVOICES)); + end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_DONTKICKVOICES).c_str()); need_comma = 1; } if (ci->botflags.HasFlag(BS_FANTASY)) { - end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", getstring(u, BOT_INFO_OPT_FANTASY)); + end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_FANTASY).c_str()); need_comma = 1; } if (ci->botflags.HasFlag(BS_GREET)) { - end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", getstring(u, BOT_INFO_OPT_GREET)); + end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_GREET).c_str()); need_comma = 1; } if (ci->botflags.HasFlag(BS_NOBOT)) { - end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", getstring(u, BOT_INFO_OPT_NOBOT)); + end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_NOBOT).c_str()); need_comma = 1; } if (ci->botflags.HasFlag(BS_SYMBIOSIS)) { - end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? commastr : "", getstring(u, BOT_INFO_OPT_SYMBIOSIS)); + end += snprintf(end, sizeof(buf) - (end - buf), "%s%s", need_comma ? ", " : "", GetString(u, BOT_INFO_OPT_SYMBIOSIS).c_str()); need_comma = 1; } - notice_lang(Config->s_BotServ, u, BOT_INFO_CHAN_OPTIONS, *buf ? buf : getstring(u, BOT_INFO_OPT_NONE)); + u->SendMessage(BotServ, BOT_INFO_CHAN_OPTIONS, *buf ? buf : GetString(u, BOT_INFO_OPT_NONE).c_str()); } else - notice_lang(Config->s_BotServ, u, BOT_INFO_NOT_FOUND, query.c_str()); + u->SendMessage(BotServ, BOT_INFO_NOT_FOUND, query.c_str()); return MOD_CONT; } bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config->s_BotServ, u, BOT_HELP_INFO); + u->SendMessage(BotServ, BOT_HELP_INFO); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "INFO", BOT_INFO_SYNTAX); + SyntaxError(BotServ, u, "INFO", BOT_INFO_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_INFO); + u->SendMessage(BotServ, BOT_HELP_CMD_INFO); } }; diff --git a/modules/core/bs_kick.cpp b/modules/core/bs_kick.cpp index 2ed3c8639..380236a43 100644 --- a/modules/core/bs_kick.cpp +++ b/modules/core/bs_kick.cpp @@ -31,15 +31,15 @@ class CommandBSKick : public Command ChannelInfo *ci = cs_findchan(chan); if (readonly) - notice_lang(Config->s_BotServ, u, BOT_KICK_DISABLED); + u->SendMessage(BotServ, BOT_KICK_DISABLED); else if (chan.empty() || option.empty() || value.empty()) - syntax_error(Config->s_BotServ, u, "KICK", BOT_KICK_SYNTAX); + SyntaxError(BotServ, u, "KICK", BOT_KICK_SYNTAX); else if (!value.equals_ci("ON") && !value.equals_ci("OFF")) - syntax_error(Config->s_BotServ, u, "KICK", BOT_KICK_SYNTAX); + SyntaxError(BotServ, u, "KICK", BOT_KICK_SYNTAX); else if (!check_access(u, ci, CA_SET) && !u->Account()->HasPriv("botserv/administration")) - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); else if (!ci->bi) - notice_help(Config->s_BotServ, u, BOT_NOT_ASSIGNED); + u->SendMessage(BotServ, BOT_NOT_ASSIGNED); else { bool override = !check_access(u, ci, CA_SET); @@ -60,7 +60,7 @@ class CommandBSKick : public Command Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BADWORDS]; /* reset the value back to 0 - TSL */ ci->ttb[TTB_BADWORDS] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -68,14 +68,14 @@ class CommandBSKick : public Command ci->ttb[TTB_BADWORDS] = 0; ci->botflags.SetFlag(BS_KICK_BADWORDS); if (ci->ttb[TTB_BADWORDS]) - notice_lang(Config->s_BotServ, u, BOT_KICK_BADWORDS_ON_BAN, ci->ttb[TTB_BADWORDS]); + u->SendMessage(BotServ, BOT_KICK_BADWORDS_ON_BAN, ci->ttb[TTB_BADWORDS]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_BADWORDS_ON); + u->SendMessage(BotServ, BOT_KICK_BADWORDS_ON); } else { ci->botflags.UnsetFlag(BS_KICK_BADWORDS); - notice_lang(Config->s_BotServ, u, BOT_KICK_BADWORDS_OFF); + u->SendMessage(BotServ, BOT_KICK_BADWORDS_OFF); } } else if (option.equals_ci("BOLDS")) @@ -90,7 +90,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BOLDS]; ci->ttb[TTB_BOLDS] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -98,14 +98,14 @@ class CommandBSKick : public Command ci->ttb[TTB_BOLDS] = 0; ci->botflags.SetFlag(BS_KICK_BOLDS); if (ci->ttb[TTB_BOLDS]) - notice_lang(Config->s_BotServ, u, BOT_KICK_BOLDS_ON_BAN, ci->ttb[TTB_BOLDS]); + u->SendMessage(BotServ, BOT_KICK_BOLDS_ON_BAN, ci->ttb[TTB_BOLDS]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_BOLDS_ON); + u->SendMessage(BotServ, BOT_KICK_BOLDS_ON); } else { ci->botflags.UnsetFlag(BS_KICK_BOLDS); - notice_lang(Config->s_BotServ, u, BOT_KICK_BOLDS_OFF); + u->SendMessage(BotServ, BOT_KICK_BOLDS_OFF); } } else if (option.equals_ci("CAPS")) @@ -123,7 +123,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_CAPS]; ci->ttb[TTB_CAPS] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -146,14 +146,14 @@ class CommandBSKick : public Command ci->botflags.SetFlag(BS_KICK_CAPS); if (ci->ttb[TTB_CAPS]) - notice_lang(Config->s_BotServ, u, BOT_KICK_CAPS_ON_BAN, ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]); + u->SendMessage(BotServ, BOT_KICK_CAPS_ON_BAN, ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_CAPS_ON, ci->capsmin, ci->capspercent); + u->SendMessage(BotServ, BOT_KICK_CAPS_ON, ci->capsmin, ci->capspercent); } else { ci->botflags.UnsetFlag(BS_KICK_CAPS); - notice_lang(Config->s_BotServ, u, BOT_KICK_CAPS_OFF); + u->SendMessage(BotServ, BOT_KICK_CAPS_OFF); } } else if (option.equals_ci("COLORS")) @@ -168,7 +168,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_COLORS]; ci->ttb[TTB_COLORS] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -176,14 +176,14 @@ class CommandBSKick : public Command ci->ttb[TTB_COLORS] = 0; ci->botflags.SetFlag(BS_KICK_COLORS); if (ci->ttb[TTB_COLORS]) - notice_lang(Config->s_BotServ, u, BOT_KICK_COLORS_ON_BAN, ci->ttb[TTB_COLORS]); + u->SendMessage(BotServ, BOT_KICK_COLORS_ON_BAN, ci->ttb[TTB_COLORS]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_COLORS_ON); + u->SendMessage(BotServ, BOT_KICK_COLORS_ON); } else { ci->botflags.UnsetFlag(BS_KICK_COLORS); - notice_lang(Config->s_BotServ, u, BOT_KICK_COLORS_OFF); + u->SendMessage(BotServ, BOT_KICK_COLORS_OFF); } } else if (option.equals_ci("FLOOD")) @@ -201,7 +201,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_FLOOD]; ci->ttb[TTB_FLOOD] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -224,14 +224,14 @@ class CommandBSKick : public Command ci->botflags.SetFlag(BS_KICK_FLOOD); if (ci->ttb[TTB_FLOOD]) - notice_lang(Config->s_BotServ, u, BOT_KICK_FLOOD_ON_BAN, ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]); + u->SendMessage(BotServ, BOT_KICK_FLOOD_ON_BAN, ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_FLOOD_ON, ci->floodlines, ci->floodsecs); + u->SendMessage(BotServ, BOT_KICK_FLOOD_ON, ci->floodlines, ci->floodsecs); } else { ci->botflags.UnsetFlag(BS_KICK_FLOOD); - notice_lang(Config->s_BotServ, u, BOT_KICK_FLOOD_OFF); + u->SendMessage(BotServ, BOT_KICK_FLOOD_OFF); } } else if (option.equals_ci("REPEAT")) @@ -248,7 +248,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REPEAT]; ci->ttb[TTB_REPEAT] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -264,14 +264,14 @@ class CommandBSKick : public Command ci->botflags.SetFlag(BS_KICK_REPEAT); if (ci->ttb[TTB_REPEAT]) - notice_lang(Config->s_BotServ, u, BOT_KICK_REPEAT_ON_BAN, ci->repeattimes, ci->ttb[TTB_REPEAT]); + u->SendMessage(BotServ, BOT_KICK_REPEAT_ON_BAN, ci->repeattimes, ci->ttb[TTB_REPEAT]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_REPEAT_ON, ci->repeattimes); + u->SendMessage(BotServ, BOT_KICK_REPEAT_ON, ci->repeattimes); } else { ci->botflags.UnsetFlag(BS_KICK_REPEAT); - notice_lang(Config->s_BotServ, u, BOT_KICK_REPEAT_OFF); + u->SendMessage(BotServ, BOT_KICK_REPEAT_OFF); } } else if (option.equals_ci("REVERSES")) @@ -286,7 +286,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REVERSES]; ci->ttb[TTB_REVERSES] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -294,14 +294,14 @@ class CommandBSKick : public Command ci->ttb[TTB_REVERSES] = 0; ci->botflags.SetFlag(BS_KICK_REVERSES); if (ci->ttb[TTB_REVERSES]) - notice_lang(Config->s_BotServ, u, BOT_KICK_REVERSES_ON_BAN, ci->ttb[TTB_REVERSES]); + u->SendMessage(BotServ, BOT_KICK_REVERSES_ON_BAN, ci->ttb[TTB_REVERSES]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_REVERSES_ON); + u->SendMessage(BotServ, BOT_KICK_REVERSES_ON); } else { ci->botflags.UnsetFlag(BS_KICK_REVERSES); - notice_lang(Config->s_BotServ, u, BOT_KICK_REVERSES_OFF); + u->SendMessage(BotServ, BOT_KICK_REVERSES_OFF); } } else if (option.equals_ci("UNDERLINES")) @@ -316,7 +316,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_UNDERLINES]; ci->ttb[TTB_UNDERLINES] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -324,14 +324,14 @@ class CommandBSKick : public Command ci->ttb[TTB_UNDERLINES] = 0; ci->botflags.SetFlag(BS_KICK_UNDERLINES); if (ci->ttb[TTB_UNDERLINES]) - notice_lang(Config->s_BotServ, u, BOT_KICK_UNDERLINES_ON_BAN, ci->ttb[TTB_UNDERLINES]); + u->SendMessage(BotServ, BOT_KICK_UNDERLINES_ON_BAN, ci->ttb[TTB_UNDERLINES]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_UNDERLINES_ON); + u->SendMessage(BotServ, BOT_KICK_UNDERLINES_ON); } else { ci->botflags.UnsetFlag(BS_KICK_UNDERLINES); - notice_lang(Config->s_BotServ, u, BOT_KICK_UNDERLINES_OFF); + u->SendMessage(BotServ, BOT_KICK_UNDERLINES_OFF); } } else if (option.equals_ci("ITALICS")) @@ -346,7 +346,7 @@ class CommandBSKick : public Command { Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS]; ci->ttb[TTB_ITALICS] = 0; - notice_lang(Config->s_BotServ, u, BOT_KICK_BAD_TTB, ttb.c_str()); + u->SendMessage(BotServ, BOT_KICK_BAD_TTB, ttb.c_str()); return MOD_CONT; } } @@ -354,18 +354,18 @@ class CommandBSKick : public Command ci->ttb[TTB_ITALICS] = 0; ci->botflags.SetFlag(BS_KICK_ITALICS); if (ci->ttb[TTB_ITALICS]) - notice_lang(Config->s_BotServ, u, BOT_KICK_ITALICS_ON_BAN, ci->ttb[TTB_ITALICS]); + u->SendMessage(BotServ, BOT_KICK_ITALICS_ON_BAN, ci->ttb[TTB_ITALICS]); else - notice_lang(Config->s_BotServ, u, BOT_KICK_ITALICS_ON); + u->SendMessage(BotServ, BOT_KICK_ITALICS_ON); } else { ci->botflags.UnsetFlag(BS_KICK_ITALICS); - notice_lang(Config->s_BotServ, u, BOT_KICK_ITALICS_OFF); + u->SendMessage(BotServ, BOT_KICK_ITALICS_OFF); } } else - notice_help(Config->s_BotServ, u, BOT_KICK_UNKNOWN, option.c_str()); + u->SendMessage(BotServ, BOT_KICK_UNKNOWN, option.c_str()); } return MOD_CONT; } @@ -373,25 +373,25 @@ class CommandBSKick : public Command bool OnHelp(User *u, const Anope::string &subcommand) { if (subcommand.empty()) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK); + u->SendMessage(BotServ, BOT_HELP_KICK); else if (subcommand.equals_ci("BADWORDS")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_BADWORDS); + u->SendMessage(BotServ, BOT_HELP_KICK_BADWORDS); else if (subcommand.equals_ci("BOLDS")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_BOLDS); + u->SendMessage(BotServ, BOT_HELP_KICK_BOLDS); else if (subcommand.equals_ci("CAPS")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_CAPS); + u->SendMessage(BotServ, BOT_HELP_KICK_CAPS); else if (subcommand.equals_ci("COLORS")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_COLORS); + u->SendMessage(BotServ, BOT_HELP_KICK_COLORS); else if (subcommand.equals_ci("FLOOD")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_FLOOD); + u->SendMessage(BotServ, BOT_HELP_KICK_FLOOD); else if (subcommand.equals_ci("REPEAT")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_REPEAT); + u->SendMessage(BotServ, BOT_HELP_KICK_REPEAT); else if (subcommand.equals_ci("REVERSES")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_REVERSES); + u->SendMessage(BotServ, BOT_HELP_KICK_REVERSES); else if (subcommand.equals_ci("UNDERLINES")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_UNDERLINES); + u->SendMessage(BotServ, BOT_HELP_KICK_UNDERLINES); else if (subcommand.equals_ci("ITALICS")) - notice_help(Config->s_BotServ, u, BOT_HELP_KICK_ITALICS); + u->SendMessage(BotServ, BOT_HELP_KICK_ITALICS); else return false; @@ -400,12 +400,12 @@ class CommandBSKick : public Command void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "KICK", BOT_KICK_SYNTAX); + SyntaxError(BotServ, u, "KICK", BOT_KICK_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_KICK); + u->SendMessage(BotServ, BOT_HELP_CMD_KICK); } }; diff --git a/modules/core/bs_say.cpp b/modules/core/bs_say.cpp index 34524e11c..a829cf368 100644 --- a/modules/core/bs_say.cpp +++ b/modules/core/bs_say.cpp @@ -31,19 +31,19 @@ class CommandBSSay : public Command if (!check_access(u, ci, CA_SAY)) { - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); return MOD_CONT; } if (!ci->bi) { - notice_help(Config->s_BotServ, u, BOT_NOT_ASSIGNED); + u->SendMessage(BotServ, BOT_NOT_ASSIGNED); return MOD_CONT; } if (!ci->c || !ci->c->FindUser(ci->bi)) { - notice_lang(Config->s_BotServ, u, BOT_NOT_ON_CHANNEL, ci->name.c_str()); + u->SendMessage(BotServ, BOT_NOT_ON_CHANNEL, ci->name.c_str()); return MOD_CONT; } @@ -64,18 +64,18 @@ class CommandBSSay : public Command bool OnHelp(User *u, const Anope::string &subcommand) { - notice_help(Config->s_BotServ, u, BOT_HELP_SAY); + u->SendMessage(BotServ, BOT_HELP_SAY); return true; } void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "SAY", BOT_SAY_SYNTAX); + SyntaxError(BotServ, u, "SAY", BOT_SAY_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_SAY); + u->SendMessage(BotServ, BOT_HELP_CMD_SAY); } }; diff --git a/modules/core/bs_set.cpp b/modules/core/bs_set.cpp index 990dba800..7f9acc5ed 100644 --- a/modules/core/bs_set.cpp +++ b/modules/core/bs_set.cpp @@ -30,7 +30,7 @@ class CommandBSSet : public Command if (readonly) { - notice_lang(Config->s_BotServ, u, BOT_SET_DISABLED); + u->SendMessage(BotServ, BOT_SET_DISABLED); return MOD_CONT; } @@ -40,28 +40,28 @@ class CommandBSSet : public Command if (!(bi = findbot(chan))) { - notice_lang(Config->s_BotServ, u, BOT_DOES_NOT_EXIST, chan.c_str()); + u->SendMessage(BotServ, BOT_DOES_NOT_EXIST, chan.c_str()); return MOD_CONT; } if (value.equals_ci("ON")) { bi->SetFlag(BI_PRIVATE); - notice_lang(Config->s_BotServ, u, BOT_SET_PRIVATE_ON, bi->nick.c_str()); + u->SendMessage(BotServ, BOT_SET_PRIVATE_ON, bi->nick.c_str()); } else if (value.equals_ci("OFF")) { bi->UnsetFlag(BI_PRIVATE); - notice_lang(Config->s_BotServ, u, BOT_SET_PRIVATE_OFF, bi->nick.c_str()); + u->SendMessage(BotServ, BOT_SET_PRIVATE_OFF, bi->nick.c_str()); } else - syntax_error(Config->s_BotServ, u, "SET PRIVATE", BOT_SET_PRIVATE_SYNTAX); + SyntaxError(BotServ, u, "SET PRIVATE", BOT_SET_PRIVATE_SYNTAX); return MOD_CONT; } else if (!(ci = cs_findchan(chan))) - notice_lang(Config->s_BotServ, u, CHAN_X_NOT_REGISTERED, chan.c_str()); + u->SendMessage(BotServ, CHAN_X_NOT_REGISTERED, chan.c_str()); else if (!u->Account()->HasPriv("botserv/administration") && !check_access(u, ci, CA_SET)) - notice_lang(Config->s_BotServ, u, ACCESS_DENIED); + u->SendMessage(BotServ, ACCESS_DENIED); else { bool override = !check_access(u, ci, CA_SET); @@ -72,60 +72,60 @@ class CommandBSSet : public Command if (value.equals_ci("ON")) { ci->botflags.SetFlag(BS_DONTKICKOPS); - notice_lang(Config->s_BotServ, u, BOT_SET_DONTKICKOPS_ON, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_DONTKICKOPS_ON, ci->name.c_str()); } else if (value.equals_ci("OFF")) { ci->botflags.UnsetFlag(BS_DONTKICKOPS); - notice_lang(Config->s_BotServ, u, BOT_SET_DONTKICKOPS_OFF, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_DONTKICKOPS_OFF, ci->name.c_str()); } else - syntax_error(Config->s_BotServ, u, "SET DONTKICKOPS", BOT_SET_DONTKICKOPS_SYNTAX); + SyntaxError(BotServ, u, "SET DONTKICKOPS", BOT_SET_DONTKICKOPS_SYNTAX); } else if (option.equals_ci("DONTKICKVOICES")) { if (value.equals_ci("ON")) { ci->botflags.SetFlag(BS_DONTKICKVOICES); - notice_lang(Config->s_BotServ, u, BOT_SET_DONTKICKVOICES_ON, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_DONTKICKVOICES_ON, ci->name.c_str()); } else if (value.equals_ci("OFF")) { ci->botflags.UnsetFlag(BS_DONTKICKVOICES); - notice_lang(Config->s_BotServ, u, BOT_SET_DONTKICKVOICES_OFF, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_DONTKICKVOICES_OFF, ci->name.c_str()); } else - syntax_error(Config->s_BotServ, u, "SET DONTKICKVOICES", BOT_SET_DONTKICKVOICES_SYNTAX); + SyntaxError(BotServ, u, "SET DONTKICKVOICES", BOT_SET_DONTKICKVOICES_SYNTAX); } else if (option.equals_ci("FANTASY")) { if (value.equals_ci("ON")) { ci->botflags.SetFlag(BS_FANTASY); - notice_lang(Config->s_BotServ, u, BOT_SET_FANTASY_ON, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_FANTASY_ON, ci->name.c_str()); } else if (value.equals_ci("OFF")) { ci->botflags.UnsetFlag(BS_FANTASY); - notice_lang(Config->s_BotServ, u, BOT_SET_FANTASY_OFF, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_FANTASY_OFF, ci->name.c_str()); } else - syntax_error(Config->s_BotServ, u, "SET FANTASY", BOT_SET_FANTASY_SYNTAX); + SyntaxError(BotServ, u, "SET FANTASY", BOT_SET_FANTASY_SYNTAX); } else if (option.equals_ci("GREET")) { if (value.equals_ci("ON")) { ci->botflags.SetFlag(BS_GREET); - notice_lang(Config->s_BotServ, u, BOT_SET_GREET_ON, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_GREET_ON, ci->name.c_str()); } else if (value.equals_ci("OFF")) { ci->botflags.UnsetFlag(BS_GREET); - notice_lang(Config->s_BotServ, u, BOT_SET_GREET_OFF, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_GREET_OFF, ci->name.c_str()); } else - syntax_error(Config->s_BotServ, u, "SET GREET", BOT_SET_GREET_SYNTAX); + SyntaxError(BotServ, u, "SET GREET", BOT_SET_GREET_SYNTAX); } else if (u->Account()->HasCommand("botserv/set/nobot") && option.equals_ci("NOBOT")) { @@ -134,33 +134,33 @@ class CommandBSSet : public Command ci->botflags.SetFlag(BS_NOBOT); if (ci->bi) ci->bi->UnAssign(u, ci); - notice_lang(Config->s_BotServ, u, BOT_SET_NOBOT_ON, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_NOBOT_ON, ci->name.c_str()); } else if (value.equals_ci("OFF")) { ci->botflags.UnsetFlag(BS_NOBOT); - notice_lang(Config->s_BotServ, u, BOT_SET_NOBOT_OFF, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_NOBOT_OFF, ci->name.c_str()); } else - syntax_error(Config->s_BotServ, u, "SET NOBOT", BOT_SET_NOBOT_SYNTAX); + SyntaxError(BotServ, u, "SET NOBOT", BOT_SET_NOBOT_SYNTAX); } else if (option.equals_ci("SYMBIOSIS")) { if (value.equals_ci("ON")) { ci->botflags.SetFlag(BS_SYMBIOSIS); - notice_lang(Config->s_BotServ, u, BOT_SET_SYMBIOSIS_ON, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_SYMBIOSIS_ON, ci->name.c_str()); } else if (value.equals_ci("OFF")) { ci->botflags.UnsetFlag(BS_SYMBIOSIS); - notice_lang(Config->s_BotServ, u, BOT_SET_SYMBIOSIS_OFF, ci->name.c_str()); + u->SendMessage(BotServ, BOT_SET_SYMBIOSIS_OFF, ci->name.c_str()); } else - syntax_error(Config->s_BotServ, u, "SET SYMBIOSIS", BOT_SET_SYMBIOSIS_SYNTAX); + SyntaxError(BotServ, u, "SET SYMBIOSIS", BOT_SET_SYMBIOSIS_SYNTAX); } else - notice_help(Config->s_BotServ, u, BOT_SET_UNKNOWN, option.c_str()); + u->SendMessage(BotServ, BOT_SET_UNKNOWN, option.c_str()); } return MOD_CONT; } @@ -169,24 +169,24 @@ class CommandBSSet : public Command { if (subcommand.empty()) { - notice_help(Config->s_BotServ, u, BOT_HELP_SET); + u->SendMessage(BotServ, BOT_HELP_SET); if (u->Account() && u->Account()->IsServicesOper()) - notice_help(Config->s_BotServ, u, BOT_SERVADMIN_HELP_SET); + u->SendMessage(BotServ, BOT_SERVADMIN_HELP_SET); } else if (subcommand.equals_ci("DONTKICKOPS")) - notice_help(Config->s_BotServ, u, BOT_HELP_SET_DONTKICKOPS); + u->SendMessage(BotServ, BOT_HELP_SET_DONTKICKOPS); else if (subcommand.equals_ci("DONTKICKVOICES")) - notice_help(Config->s_BotServ, u, BOT_HELP_SET_DONTKICKVOICES); + u->SendMessage(BotServ, BOT_HELP_SET_DONTKICKVOICES); else if (subcommand.equals_ci("FANTASY")) - notice_help(Config->s_BotServ, u, BOT_HELP_SET_FANTASY); + u->SendMessage(BotServ, BOT_HELP_SET_FANTASY); else if (subcommand.equals_ci("GREET")) - notice_help(Config->s_BotServ, u, BOT_HELP_SET_GREET); + u->SendMessage(BotServ, BOT_HELP_SET_GREET); else if (subcommand.equals_ci("SYMBIOSIS")) - notice_lang(Config->s_BotServ, u, BOT_HELP_SET_SYMBIOSIS, Config->s_ChanServ.c_str()); + u->SendMessage(BotServ, BOT_HELP_SET_SYMBIOSIS, Config->s_ChanServ.c_str()); else if (subcommand.equals_ci("NOBOT")) - notice_lang(Config->s_BotServ, u, BOT_SERVADMIN_HELP_SET_NOBOT); + u->SendMessage(BotServ, BOT_SERVADMIN_HELP_SET_NOBOT); else if (subcommand.equals_ci("PRIVATE")) - notice_lang(Config->s_BotServ, u, BOT_SERVADMIN_HELP_SET_PRIVATE); + u->SendMessage(BotServ, BOT_SERVADMIN_HELP_SET_PRIVATE); else return false; @@ -195,12 +195,12 @@ class CommandBSSet : public Command void OnSyntaxError(User *u, const Anope::string &subcommand) { - syntax_error(Config->s_BotServ, u, "SET", BOT_SET_SYNTAX); + SyntaxError(BotServ, u, "SET", BOT_SET_SYNTAX); } void OnServHelp(User *u) { - notice_lang(Config->s_BotServ, u, BOT_HELP_CMD_SET); + u->SendMessage(BotServ, BOT_HELP_CMD_SET); } }; diff --git a/modules/core/bs_unassign.cpp b/modules/core/bs_unassign.cpp index 6b6b28fe9..c381ec61a 100644 --- a/modules/core/bs_unassign.cpp +++ b/modules/core/bs_unassign.cpp @@ -27,38 +27,38 @@ class CommandBSUnassign : public Command ChannelMode *cm = ModeManager::FindChannelModeByName(CMODE_PERM);