summaryrefslogtreecommitdiff
path: root/modules/commands/bs_bot.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
committerAdam <Adam@anope.org>2012-06-18 05:04:30 -0400
commit2dec8e767a70def4b9b04a96ae4f75e4d1013038 (patch)
tree36f5b551ff359a578e17d5e7d2f486970d759a7b /modules/commands/bs_bot.cpp
parent873d4287de57f7f9caa23cb2c9265d1ad2804aba (diff)
Allow userless command sources
Diffstat (limited to 'modules/commands/bs_bot.cpp')
-rw-r--r--modules/commands/bs_bot.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp
index b1f22909f..0b45ee71c 100644
--- a/modules/commands/bs_bot.cpp
+++ b/modules/commands/bs_bot.cpp
@@ -94,7 +94,7 @@ class CommandBSBot : public Command
BotInfo *bi = new BotInfo(nick, user, host, real);
- Log(LOG_ADMIN, source.u, this) << "ADD " << bi->GetMask() << " " << bi->realname;
+ Log(LOG_ADMIN, source, this) << "ADD " << bi->GetMask() << " " << bi->realname;
source.Reply(_("%s!%s@%s (%s) added to the bot list."), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
@@ -253,7 +253,7 @@ class CommandBSBot : public Command
}
source.Reply(_("Bot \002%s\002 has been changed to %s!%s@%s (%s)"), oldnick.c_str(), bi->nick.c_str(), bi->GetIdent().c_str(), bi->host.c_str(), bi->realname.c_str());
- Log(LOG_ADMIN, source.u, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname;
+ Log(LOG_ADMIN, source, this) << "CHANGE " << oldnick << " to " << bi->GetMask() << " " << bi->realname;
FOREACH_MOD(I_OnBotChange, OnBotChange(bi));
return;
@@ -284,7 +284,7 @@ class CommandBSBot : public Command
FOREACH_MOD(I_OnBotDelete, OnBotDelete(bi));
- Log(LOG_ADMIN, source.u, this) << "DEL " << bi->nick;
+ Log(LOG_ADMIN, source, this) << "DEL " << bi->nick;
source.Reply(_("Bot \002%s\002 has been deleted."), nick.c_str());
bi->destroy();
@@ -302,7 +302,6 @@ class CommandBSBot : public Command
void Execute(CommandSource &source, const std::vector<Anope::string> &params) anope_override
{
const Anope::string &cmd = params[0];
- User *u = source.u;
if (readonly)
{
@@ -313,7 +312,7 @@ class CommandBSBot : public Command
if (cmd.equals_ci("ADD"))
{
// ADD nick user host real - 5
- if (!u->HasCommand("botserv/bot/add"))
+ if (!source.HasCommand("botserv/bot/add"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -336,7 +335,7 @@ class CommandBSBot : public Command
{
// CHANGE oldn newn user host real - 6
// but only oldn and newn are required
- if (!u->HasCommand("botserv/bot/change"))
+ if (!source.HasCommand("botserv/bot/change"))
{
source.Reply(ACCESS_DENIED);
return;
@@ -353,7 +352,7 @@ class CommandBSBot : public Command
else if (cmd.equals_ci("DEL"))
{
// DEL nick
- if (!u->HasCommand("botserv/bot/del"))
+ if (!source.HasCommand("botserv/bot/del"))
{
source.Reply(ACCESS_DENIED);
return;