mirror of
https://github.com/anope/anope.git
synced 2026-06-30 07:16:38 +02:00
Merge delbot() and cs_remove_bot() into BotInfo's destructor.
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1281 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
@@ -34,6 +34,31 @@ BotInfo::BotInfo(const char *nnick, const char *nuser, const char *nhost, const
|
||||
nbots++;
|
||||
}
|
||||
|
||||
BotInfo::~BotInfo()
|
||||
{
|
||||
int i;
|
||||
ChannelInfo *ci;
|
||||
|
||||
for (i = 0; i < 256; i++)
|
||||
for (ci = chanlists[i]; ci; ci = ci->next)
|
||||
if (ci->bi == this)
|
||||
ci->bi = NULL;
|
||||
|
||||
if (this->next)
|
||||
this->next->prev = this->prev;
|
||||
if (this->prev)
|
||||
this->prev->next = this->next;
|
||||
else
|
||||
botlists[tolower(*this->nick)] = this->next;
|
||||
|
||||
nbots--;
|
||||
|
||||
free(this->nick);
|
||||
free(this->user);
|
||||
free(this->host);
|
||||
free(this->real);
|
||||
}
|
||||
|
||||
|
||||
void BotInfo::ChangeNick(const char *newnick)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user