summaryrefslogtreecommitdiff
path: root/modules/commands/bs_bot.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2015-06-29 08:42:29 -0400
committerAdam <Adam@anope.org>2015-06-29 08:42:29 -0400
commit3e3312db259b3126e84ad2c1730c23c6f5ee8284 (patch)
tree0f45ae34939b4a22a8d93586ee5c49f9dbf58629 /modules/commands/bs_bot.cpp
parentbb5c4906cc09df213c782342f96db00570aa8194 (diff)
Don't allow adding or changing bots to collide with users
Diffstat (limited to 'modules/commands/bs_bot.cpp')
-rw-r--r--modules/commands/bs_bot.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/modules/commands/bs_bot.cpp b/modules/commands/bs_bot.cpp
index d066a49a8..6a4f0344a 100644
--- a/modules/commands/bs_bot.cpp
+++ b/modules/commands/bs_bot.cpp
@@ -75,6 +75,13 @@ class CommandBSBot : public Command
return;
}
+ User *u = User::Find(nick, true);
+ if (u)
+ {
+ source.Reply(_("User \2%s\2 is already in use."), u->nick.c_str());
+ return;
+ }
+
BotInfo *bi = new BotInfo(nick, user, host, real);
Log(LOG_ADMIN, source, this) << "ADD " << bi->GetMask() << " " << bi->realname;
@@ -161,10 +168,19 @@ class CommandBSBot : public Command
return;
}
- if (!nick.equals_ci(bi->nick) && BotInfo::Find(nick, true))
+ if (!nick.equals_ci(bi->nick))
{
- source.Reply(_("Bot \002%s\002 already exists."), nick.c_str());
- return;
+ if (BotInfo::Find(nick, true))
+ {
+ source.Reply(_("Bot \002%s\002 already exists."), nick.c_str());
+ return;
+ }
+
+ if (User::Find(nick, true))
+ {
+ source.Reply(_("User \2%s\2 is already in use."), nick.c_str());
+ return;
+ }
}
if (!nick.equals_ci(bi->nick))