mirror of
https://github.com/anope/anope.git
synced 2026-07-07 04:43:13 +02:00
Fixed bug #1095, do not resend client introduction when using /botserv bot add and initialized chancount in BotInfo constructor
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2460 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -21,6 +21,7 @@ BotInfo::BotInfo(const char *nnick)
|
||||
nbots++;
|
||||
this->cmdTable = NULL;
|
||||
this->flags = 0;
|
||||
this->chancount = 0;
|
||||
|
||||
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
|
||||
this->flags |= BI_CHANSERV;
|
||||
@@ -55,6 +56,7 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const
|
||||
nbots++;
|
||||
this->cmdTable = NULL;
|
||||
this->flags = 0;
|
||||
this->chancount = 0;
|
||||
|
||||
if (s_ChanServ && !stricmp(s_ChanServ, nnick))
|
||||
this->flags |= BI_CHANSERV;
|
||||
|
||||
+1
-13
@@ -107,27 +107,15 @@ class CommandBSBot : public Command
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bi = new BotInfo(nick);
|
||||
if (!bi)
|
||||
if (!(bi = new BotInfo(nick, user, host, real)))
|
||||
{
|
||||
notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED);
|
||||
return MOD_CONT;
|
||||
}
|
||||
|
||||
bi->user = sstrdup(user);
|
||||
bi->host = sstrdup(host);
|
||||
bi->real = sstrdup(real);
|
||||
bi->created = time(NULL);
|
||||
bi->flags = 0;
|
||||
bi->chancount = 0;
|
||||
|
||||
/* We check whether user with this nick is online, and kill it if so */
|
||||
EnforceQlinedNick(nick, s_BotServ);
|
||||
|
||||
/* We make the bot online, ready to serve */
|
||||
ircdproto->SendClientIntroduction(bi->nick, bi->user, bi->host, bi->real,
|
||||
ircd->pseudoclient_mode, bi->uid.c_str());
|
||||
|
||||
notice_lang(s_BotServ, u, BOT_BOT_ADDED, bi->nick, bi->user,
|
||||
bi->host, bi->real);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user