diff options
Diffstat (limited to 'modules/botserv')
| -rw-r--r-- | modules/botserv/botserv.cpp | 30 | ||||
| -rw-r--r-- | modules/botserv/bs_autoassign.cpp | 2 | ||||
| -rw-r--r-- | modules/botserv/bs_badwords.cpp | 4 | ||||
| -rw-r--r-- | modules/botserv/bs_kick.cpp | 10 | ||||
| -rw-r--r-- | modules/botserv/bs_set.cpp | 4 |
5 files changed, 25 insertions, 25 deletions
diff --git a/modules/botserv/botserv.cpp b/modules/botserv/botserv.cpp index 0646668be..e77ffe46c 100644 --- a/modules/botserv/botserv.cpp +++ b/modules/botserv/botserv.cpp @@ -23,9 +23,9 @@ public: { } - void OnReload(Configuration::Conf *conf) override + void OnReload(Configuration::Conf &conf) override { - const Anope::string &bsnick = conf->GetModule(this)->Get<const Anope::string>("client"); + const Anope::string &bsnick = conf.GetModule(this).Get<const Anope::string>("client"); BotServ = BotInfo::Find(bsnick, true); } @@ -34,7 +34,7 @@ public: /* Do not allow removing bot modes on our service bots */ if (chan->ci && chan->ci->bi == user) { - const Anope::string &botmodes = Config->GetModule(this)->Get<const Anope::string>("botmodes"); + const Anope::string &botmodes = Config->GetModule(this).Get<const Anope::string>("botmodes"); for (auto botmode : botmodes) chan->SetMode(chan->ci->bi, ModeManager::FindChannelModeByChar(botmode), chan->ci->bi->GetUID()); } @@ -42,9 +42,9 @@ public: void OnBotAssign(User *sender, ChannelInfo *ci, BotInfo *bi) override { - if (ci->c && ci->c->users.size() >= Config->GetModule(this)->Get<unsigned>("minusers")) + if (ci->c && ci->c->users.size() >= Config->GetModule(this).Get<unsigned>("minusers")) { - ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes")); + ChannelStatus status(Config->GetModule(this).Get<const Anope::string>("botmodes")); bi->Join(ci->c, &status); } } @@ -55,7 +55,7 @@ public: return; BotInfo *bi = user->server == Me ? dynamic_cast<BotInfo *>(user) : NULL; - if (bi && Config->GetModule(this)->Get<bool>("smartjoin")) + if (bi && Config->GetModule(this).Get<bool>("smartjoin")) { if (IRCD->CanClearBans) { @@ -99,9 +99,9 @@ public: * legit users - Rob **/ /* This is before the user has joined the channel, so check usercount + 1 */ - if (c->users.size() + 1 >= Config->GetModule(this)->Get<unsigned>("minusers") && !c->FindUser(c->ci->bi)) + if (c->users.size() + 1 >= Config->GetModule(this).Get<unsigned>("minusers") && !c->FindUser(c->ci->bi)) { - ChannelStatus status(Config->GetModule(this)->Get<const Anope::string>("botmodes")); + ChannelStatus status(Config->GetModule(this).Get<const Anope::string>("botmodes")); c->ci->bi->Join(c, &status); } } @@ -124,7 +124,7 @@ public: return; /* This is called prior to removing the user from the channel, so c->users.size() - 1 should be safe */ - if (c->ci && c->ci->bi && u != *c->ci->bi && c->users.size() - 1 <= Config->GetModule(this)->Get<unsigned>("minusers") && c->FindUser(c->ci->bi)) + if (c->ci && c->ci->bi && u != *c->ci->bi && c->users.size() - 1 <= Config->GetModule(this).Get<unsigned>("minusers") && c->FindUser(c->ci->bi)) c->ci->bi->Part(c->ci->c); } @@ -140,7 +140,7 @@ public: "channel, and provide a more convenient way to execute commands. Commands that\n" "require a channel as a parameter will automatically have that parameter\n" "given.\n"), source.service->nick.c_str()); - const Anope::string &fantasycharacters = Config->GetModule("fantasy")->Get<const Anope::string>("fantasycharacter", "!"); + const Anope::string &fantasycharacters = Config->GetModule("fantasy").Get<const Anope::string>("fantasycharacter", "!"); if (!fantasycharacters.empty()) source.Reply(_(" \n" "Fantasy commands may be prefixed with one of the following characters: %s\n"), fantasycharacters.c_str()); @@ -170,8 +170,8 @@ public: source.Reply(_(" \n" "Bot will join a channel whenever there is at least\n" - "\002%d\002 user(s) on it."), Config->GetModule(this)->Get<unsigned>("minusers")); - const Anope::string &fantasycharacters = Config->GetModule("fantasy")->Get<const Anope::string>("fantasycharacter", "!"); + "\002%d\002 user(s) on it."), Config->GetModule(this).Get<unsigned>("minusers")); + const Anope::string &fantasycharacters = Config->GetModule("fantasy").Get<const Anope::string>("fantasycharacter", "!"); if (!fantasycharacters.empty()) source.Reply(_("Additionally, if fantasy is enabled fantasy commands\n" "can be executed by prefixing the command name with\n" @@ -180,7 +180,7 @@ public: EventReturn OnChannelModeSet(Channel *c, MessageSource &source, ChannelMode *mode, const Anope::string ¶m) override { - if (source.GetUser() && !source.GetBot() && Config->GetModule(this)->Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi)) + if (source.GetUser() && !source.GetBot() && Config->GetModule(this).Get<bool>("smartjoin") && mode->name == "BAN" && c->ci && c->ci->bi && c->FindUser(c->ci->bi)) { BotInfo *bi = c->ci->bi; @@ -195,7 +195,7 @@ public: void OnCreateChan(ChannelInfo *ci) override { /* Set default bot flags */ - spacesepstream sep(Config->GetModule(this)->Get<const Anope::string>("defaults", "greet fantasy")); + spacesepstream sep(Config->GetModule(this).Get<const Anope::string>("defaults", "greet fantasy")); for (Anope::string token; sep.GetToken(token);) ci->Extend<bool>("BS_" + token.upper()); } @@ -211,7 +211,7 @@ public: void OnCreateBot(BotInfo *bi) override { if (bi->botmodes.empty()) - bi->botmodes = Config->GetModule(this)->Get<const Anope::string>("botumodes"); + bi->botmodes = Config->GetModule(this).Get<const Anope::string>("botumodes"); } }; diff --git a/modules/botserv/bs_autoassign.cpp b/modules/botserv/bs_autoassign.cpp index e988540fe..5292f8642 100644 --- a/modules/botserv/bs_autoassign.cpp +++ b/modules/botserv/bs_autoassign.cpp @@ -19,7 +19,7 @@ public: void OnChanRegistered(ChannelInfo *ci) override { - const Anope::string &bot = Config->GetModule(this)->Get<const Anope::string>("bot"); + const Anope::string &bot = Config->GetModule(this).Get<const Anope::string>("bot"); if (bot.empty()) return; diff --git a/modules/botserv/bs_badwords.cpp b/modules/botserv/bs_badwords.cpp index 5301fd042..95f749488 100644 --- a/modules/botserv/bs_badwords.cpp +++ b/modules/botserv/bs_badwords.cpp @@ -286,14 +286,14 @@ private: realword = word.substr(0, pos); } - unsigned badwordsmax = Config->GetModule(this->module)->Get<unsigned>("badwordsmax"); + unsigned badwordsmax = Config->GetModule(this->module).Get<unsigned>("badwordsmax"); if (badwords->GetBadWordCount() >= badwordsmax) { source.Reply(_("Sorry, you can only have %d bad words entries on a channel."), badwordsmax); return; } - bool casesensitive = Config->GetModule(this->module)->Get<bool>("casesensitive"); + bool casesensitive = Config->GetModule(this->module).Get<bool>("casesensitive"); for (unsigned i = 0, end = badwords->GetBadWordCount(); i < end; ++i) { diff --git a/modules/botserv/bs_kick.cpp b/modules/botserv/bs_kick.cpp index caaa51b01..eba2868a6 100644 --- a/modules/botserv/bs_kick.cpp +++ b/modules/botserv/bs_kick.cpp @@ -515,8 +515,8 @@ public: if (kd->floodsecs < 1) kd->floodsecs = 10; - if (kd->floodsecs > Config->GetModule(me)->Get<time_t>("keepdata")) - kd->floodsecs = Config->GetModule(me)->Get<time_t>("keepdata"); + if (kd->floodsecs > Config->GetModule(me).Get<time_t>("keepdata")) + kd->floodsecs = Config->GetModule(me).Get<time_t>("keepdata"); kd->flood = true; if (kd->ttb[TTB_FLOOD]) @@ -913,7 +913,7 @@ public: void purge() { - time_t keepdata = Config->GetModule(me)->Get<time_t>("keepdata"); + time_t keepdata = Config->GetModule(me).Get<time_t>("keepdata"); for (data_type::iterator it = data_map.begin(), it_end = data_map.end(); it != it_end;) { const Anope::string &user = it->first; @@ -1299,7 +1299,7 @@ public: /* Normalize the buffer */ Anope::string nbuf = Anope::NormalizeBuffer(realbuf); - bool casesensitive = Config->GetModule("botserv")->Get<bool>("casesensitive"); + bool casesensitive = Config->GetModule("botserv").Get<bool>("casesensitive"); /* Normalize can return an empty string if this only contains control codes etc */ if (badwords && !nbuf.empty()) @@ -1368,7 +1368,7 @@ public: if (mustkick) { check_ban(ci, u, kd, TTB_BADWORDS); - if (Config->GetModule(me)->Get<bool>("gentlebadwordreason")) + if (Config->GetModule(me).Get<bool>("gentlebadwordreason")) bot_kick(ci, u, _("Watch your language!")); else bot_kick(ci, u, _("Don't use the word \"%s\" on this channel!"), bw->word.c_str()); diff --git a/modules/botserv/bs_set.cpp b/modules/botserv/bs_set.cpp index 1ab00205d..9b536e19a 100644 --- a/modules/botserv/bs_set.cpp +++ b/modules/botserv/bs_set.cpp @@ -33,8 +33,8 @@ public: source.Reply(_("Configures bot options.\n" " \n" "Available options:")); - bool hide_privileged_commands = Config->GetBlock("options")->Get<bool>("hideprivilegedcommands"), - hide_registered_commands = Config->GetBlock("options")->Get<bool>("hideregisteredcommands"); + bool hide_privileged_commands = Config->GetBlock("options").Get<bool>("hideprivilegedcommands"), + hide_registered_commands = Config->GetBlock("options").Get<bool>("hideregisteredcommands"); Anope::string this_name = source.command; for (const auto &[c_name, info] : source.service->commands) { |
