summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-12-29 19:59:26 -0500
committerAdam <Adam@anope.org>2010-12-29 19:59:26 -0500
commita36f14c1bfca63ba744ab310af775cf6d5b81179 (patch)
tree699fefdd972c23799117a44f3ddab3606c324d4b
parent16cab979da3330f87c3fb6a23c849a028b8ab594 (diff)
Automatically quit bots when they are deleted
-rw-r--r--modules/core/bs_bot.cpp4
-rw-r--r--modules/core/ss_main.cpp1
-rw-r--r--src/bots.cpp8
-rw-r--r--src/nickserv.cpp2
4 files changed, 9 insertions, 6 deletions
diff --git a/modules/core/bs_bot.cpp b/modules/core/bs_bot.cpp
index a449ef23a..e59f683dd 100644
--- a/modules/core/bs_bot.cpp
+++ b/modules/core/bs_bot.cpp
@@ -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());
diff --git a/modules/core/ss_main.cpp b/modules/core/ss_main.cpp
index b228ad33e..8ee7611d3 100644
--- a/modules/core/ss_main.cpp
+++ b/modules/core/ss_main.cpp
@@ -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;
}
}
diff --git a/src/bots.cpp b/src/bots.cpp
index 07ea91b3a..1f7b118d8 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -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;
diff --git a/src/nickserv.cpp b/src/nickserv.cpp
index 6212c7d3e..63abf59b3 100644
--- a/src/nickserv.cpp
+++ b/src/nickserv.cpp
@@ -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)