summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDukePyrolator <DukePyrolator@anope.org>2010-12-26 09:36:45 +0100
committerDukePyrolator <DukePyrolator@anope.org>2010-12-26 09:36:45 +0100
commitf638d1078ab5ab630ce9393fe87edd630abdf75a (patch)
tree2afbda6b0a653324657e41d3ddc8a698a37e3b29 /src
parent4235df2b28a26cb166a250d016f1fd9b417cb94b (diff)
parent8af2465a61b09e020c1324acfb78bbf912869fc8 (diff)
Merge branch '1.9' of ssh://anope.git.sourceforge.net/gitroot/anope/anope into 1.9
Diffstat (limited to 'src')
-rw-r--r--src/bots.cpp8
-rw-r--r--src/chanserv.cpp4
-rw-r--r--src/modules.cpp3
-rw-r--r--src/nickcore.cpp4
-rw-r--r--src/operserv.cpp11
-rw-r--r--src/regchannel.cpp4
6 files changed, 22 insertions, 12 deletions
diff --git a/src/bots.cpp b/src/bots.cpp
index 87a646923..07ea91b3a 100644
--- a/src/bots.cpp
+++ b/src/bots.cpp
@@ -72,6 +72,14 @@ BotInfo::~BotInfo()
ci->bi = NULL;
}
+ for (CommandMap::const_iterator it = this->Commands.begin(), it_end = this->Commands.end(); it != it_end; ++it)
+ {
+ Command *c = it->second;
+
+ if (c->module)
+ c->module->DelCommand(this, c);
+ }
+
BotListByNick.erase(this->nick);
if (!this->uid.empty())
BotListByUID.erase(this->uid);
diff --git a/src/chanserv.cpp b/src/chanserv.cpp
index 504bdea2a..35fd8975c 100644
--- a/src/chanserv.cpp
+++ b/src/chanserv.cpp
@@ -111,7 +111,7 @@ Anope::string get_mlock_modes(ChannelInfo *ci, int complete)
{
Anope::string pos = "+", neg = "-", params;
- for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it)
+ for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it)
{
const ModeLock &ml = it->second;
ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name);
@@ -241,7 +241,7 @@ void check_modes(Channel *c)
return;
}
- for (std::map<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it)
+ for (std::multimap<ChannelModeName, ModeLock>::const_iterator it = ci->GetMLock().begin(), it_end = ci->GetMLock().end(); it != it_end; ++it)
{
const ModeLock &ml = it->second;
ChannelMode *cm = ModeManager::FindChannelModeByName(ml.name);
diff --git a/src/modules.cpp b/src/modules.cpp
index 63e6bcab3..1ca060108 100644
--- a/src/modules.cpp
+++ b/src/modules.cpp
@@ -173,6 +173,9 @@ int Module::DelCommand(BotInfo *bi, Command *c)
if (!bi->Commands.erase(c->name))
return MOD_ERR_NOEXIST;
+
+ c->module = NULL;
+ c->service = NULL;
return MOD_ERR_OK;
}
diff --git a/src/nickcore.cpp b/src/nickcore.cpp
index 40cd873a8..b094c8962 100644
--- a/src/nickcore.cpp
+++ b/src/nickcore.cpp
@@ -32,9 +32,9 @@ NickCore::~NickCore()
/* Clean up this nick core from any users online using it
* (ones that /nick but remain unidentified)
*/
- for (std::list<User *>::iterator it = this->Users.begin(), it_end = this->Users.end(); it != it_end; ++it)
+ for (std::list<User *>::iterator it = this->Users.begin(); it != this->Users.end();)
{
- User *user = *it;
+ User *user = *it++;
ircdproto->SendAccountLogout(user, user->Account());
user->RemoveMode(NickServ, UMODE_REGISTERED);
ircdproto->SendUnregisteredNick(user);
diff --git a/src/operserv.cpp b/src/operserv.cpp
index c76b34375..6437fa2c9 100644
--- a/src/operserv.cpp
+++ b/src/operserv.cpp
@@ -324,9 +324,8 @@ XLine *XLineManager::GetEntry(unsigned index)
*/
void XLineManager::Clear()
{
- for (std::vector<XLine *>::iterator it = this->XLines.begin(), it_end = this->XLines.end(); it != it_end; ++it)
- delete *it;
- this->XLines.clear();
+ while (!this->XLines.empty())
+ this->DelXLine(this->XLines.front());
}
/** Add an entry to this XLine Manager
@@ -606,7 +605,7 @@ XLine *SNLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
User *user = *it;
++it;
- if (!user->HasMode(UMODE_OPER) && Anope::Match(user->realname, x->Mask))
+ if (!user->HasMode(UMODE_OPER) && user->server != Me && Anope::Match(user->realname, x->Mask))
kill_user(Config->ServerName, user, rreason);
}
}
@@ -698,7 +697,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
UserContainer *uc = *it;
++it;
- if (uc->user->HasMode(UMODE_OPER))
+ if (uc->user->HasMode(UMODE_OPER) || uc->user->server == Me)
continue;
c->Kick(NULL, uc->user, "%s", reason.c_str());
}
@@ -711,7 +710,7 @@ XLine *SQLineManager::Add(BotInfo *bi, User *u, const Anope::string &mask, time_
User *user = *it;
++it;
- if (!user->HasMode(UMODE_OPER) && Anope::Match(user->nick, x->Mask))
+ if (!user->HasMode(UMODE_OPER) && user->server != Me && Anope::Match(user->nick, x->Mask))
kill_user(Config->ServerName, user, rreason);
}
}
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 62dc94b3d..17c141ea7 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -579,13 +579,13 @@ void ChannelInfo::LoadMLock()
*/
bool ChannelInfo::HasMLock(ChannelMode *mode, const Anope::string &param, bool status) const
{
- std::map<ChannelModeName, ModeLock>::const_iterator it = this->mode_locks.find(mode->Name);
+ std::multimap<ChannelModeName, ModeLock>::const_iterator it = this->mode_locks.find(mode->Name);
if (it != this->mode_locks.end())
{
if (mode->Type != MODE_REGULAR)
{
- std::map<ChannelModeName, ModeLock>::const_iterator it_end = this->mode_locks.upper_bound(mode->Name);
+ std::multimap<ChannelModeName, ModeLock>::const_iterator it_end = this->mode_locks.upper_bound(mode->Name);
for (; it != it_end; ++it)
{
const ModeLock &ml = it->second;