From a36f14c1bfca63ba744ab310af775cf6d5b81179 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 29 Dec 2010 19:59:26 -0500 Subject: Automatically quit bots when they are deleted --- src/bots.cpp | 8 ++++++++ src/nickserv.cpp | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) (limited to 'src') 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(this), NULL); + ircdproto->SendQuit(this, NULL); } void NickServRelease::Tick(time_t) -- cgit