summaryrefslogtreecommitdiff
path: root/src/regchannel.cpp
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-18 02:51:46 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-18 02:51:46 +0000
commit5179a0a40f7edcf510fd3b296962c4d90c0840f9 (patch)
tree56a479f11b2c6f72ea80cbbdc6d7976203b4c3ec /src/regchannel.cpp
parentda8a1c7b6068dcc079d6f710a877ed53fabff86f (diff)
Delete the correct entries from akick and badwords list when given a numlist
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2657 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/regchannel.cpp')
-rw-r--r--src/regchannel.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/regchannel.cpp b/src/regchannel.cpp
index 1ecb97697..6bf2c64fe 100644
--- a/src/regchannel.cpp
+++ b/src/regchannel.cpp
@@ -247,7 +247,7 @@ AutoKick *ChannelInfo::AddAkick(const std::string &user, NickCore *akicknc, cons
return NULL;
AutoKick *autokick = new AutoKick();
- autokick->SetFlag(AK_USED);
+ autokick->InUse = true;
autokick->SetFlag(AK_ISNICK);
autokick->nc = akicknc;
autokick->reason = reason;
@@ -269,7 +269,7 @@ AutoKick *ChannelInfo::AddAkick(const std::string &user, const std::string &mask
{
AutoKick *autokick = new AutoKick();
autokick->mask = mask;
- autokick->SetFlag(AK_USED);
+ autokick->InUse = true;
autokick->reason = reason;
autokick->creator = user;
autokick->addtime = t;
@@ -322,6 +322,15 @@ void ChannelInfo::ClearAkick()
}
}
+/** Clean all of the nonused entries from the akick list
+ */
+void ChannelInfo::CleanAkick()
+{
+ for (unsigned i = akick.size(); i > 0; --i)
+ if (!akick[i - 1]->InUse)
+ EraseAkick(akick[i - 1]);
+}
+
/** Add a badword to the badword list
* @param word The badword
* @param type The type (SINGLE START END)
@@ -330,6 +339,7 @@ void ChannelInfo::ClearAkick()
BadWord *ChannelInfo::AddBadWord(const std::string &word, BadWordType type)
{
BadWord *bw = new BadWord;
+ bw->InUse = true;
bw->word = word;
bw->type = type;
@@ -381,6 +391,15 @@ void ChannelInfo::ClearBadWords()
}
}
+/** Clean all of the nonused entries from the badwords list
+ */
+void ChannelInfo::CleanBadWords()
+{
+ for (unsigned i = badwords.size(); i > 0; --i)
+ if (!badwords[i - 1]->InUse)
+ EraseBadWord(badwords[i - 1]);
+}
+
/** Check if a mode is mlocked
* @param Name The mode
* @param status True to check mlock on, false for mlock off