1
0
mirror of https://github.com/anope/anope.git synced 2026-07-06 10:13:14 +02:00

Automatically quit bots when they are deleted

This commit is contained in:
Adam
2010-12-29 19:59:26 -05:00
parent 16cab979da
commit a36f14c1bf
4 changed files with 9 additions and 6 deletions
-4
View File
@@ -294,10 +294,6 @@ class CommandBSBot : public Command
FOREACH_MOD(I_OnBotDelete, OnBotDelete(bi));
ircdproto->SendQuit(bi, "Quit: Help! I'm being deleted by %s!", source.u->nick.c_str());
XLine x(bi->nick);
ircdproto->SendSQLineDel(&x);
Log(LOG_ADMIN, source.u, this) << "DEL " << bi->nick;
source.Reply(BOT_BOT_DELETED, nick.c_str());
-1
View File
@@ -57,7 +57,6 @@ class SSMain : public Module
for (CommandMap::iterator it = statserv->Commands.begin(), it_end = statserv->Commands.end(); it != it_end; ++it)
this->DelCommand(statserv, it->second);
ircdproto->SendQuit(statserv, "Quit due to module unload.");
delete statserv;
}
}
+8
View File
@@ -64,6 +64,14 @@ BotInfo::BotInfo(const Anope::string &nnick, const Anope::string &nuser, const A
BotInfo::~BotInfo()
{
// If we're synchronised with the uplink already, send the bot.
if (Me && Me->IsSynced())
{
ircdproto->SendQuit(this, NULL);
XLine x(this->nick);
ircdproto->SendSQLineDel(&x);
}
for (registered_channel_map::const_iterator it = RegisteredChannelList.begin(), it_end = RegisteredChannelList.end(); it != it_end; ++it)
{
ChannelInfo *ci = it->second;
+1 -1
View File
@@ -68,7 +68,7 @@ NickServRelease::~NickServRelease()
{
NickServReleases.erase(this->nick);
ircdproto->SendQuit(debug_cast<User *>(this), NULL);
ircdproto->SendQuit(this, NULL);
}
void NickServRelease::Tick(time_t)