summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-17 03:15:31 +0000
committerAdam- <Adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-11-17 03:15:31 +0000
commit88330c07adc5bb3b085cf6ede1d30c0c48afcfb6 (patch)
tree3effa4cdbc3c0be79bd812580d77c3884636b6ec /include
parent88c0edc8f8f2f3aad67e69593b107b7bd0a56a35 (diff)
Cleand up alot of the code in bs_badwords, made it much more C++-ish
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@2654 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'include')
-rw-r--r--include/regchannel.h34
-rw-r--r--include/services.h3
2 files changed, 31 insertions, 6 deletions
diff --git a/include/regchannel.h b/include/regchannel.h
index b6d380f40..7ce3151a6 100644
--- a/include/regchannel.h
+++ b/include/regchannel.h
@@ -63,8 +63,9 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag>
{
private:
std::map<ChannelModeName, std::string> Params; /* Map of parameters by mode name */
- std::vector<ChanAccess *> access; /* List of authorized users */
- std::vector<AutoKick *> akick; /* List of users to kickban */
+ std::vector<ChanAccess *> access; /* List of authorized users */
+ std::vector<AutoKick *> akick; /* List of users to kickban */
+ std::vector<BadWord *> badwords; /* List of badwords */
std::bitset<128> mlock_on; /* Modes mlocked on */
std::bitset<128> mlock_off; /* Modes mlocked off */
@@ -112,8 +113,6 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag>
Flags<BotServFlag> botflags;
int16 *ttb; /* Times to ban for each kicker */
- uint16 bwcount;
- BadWord *badwords; /* For BADWORDS kicker */
int16 capsmin, capspercent; /* For CAPS kicker */
int16 floodlines, floodsecs; /* For FLOOD kicker */
int16 repeattimes; /* For REPEAT kicker */
@@ -209,6 +208,33 @@ class CoreExport ChannelInfo : public Extensible, public Flags<ChannelInfoFlag>
*/
void ClearAkick();
+ /** Add a badword to the badword list
+ * @param word The badword
+ * @param type The type (SINGLE START END)
+ * @return The badword
+ */
+ BadWord *AddBadWord(const std::string &word, BadWordType type);
+
+ /** Get a badword structure by index
+ * @param index The index
+ * @return The badword
+ */
+ BadWord *GetBadWord(unsigned index);
+
+ /** Get how many badwords are on this channel
+ * @return The number of badwords in the vector
+ */
+ const unsigned GetBadWordCount() const;
+
+ /** Remove a badword
+ * @param badword The badword
+ */
+ void EraseBadWord(BadWord *badword);
+
+ /** Clear all badwords from the channel
+ */
+ void ClearBadWords();
+
/** Check if a mode is mlocked
* @param Name The mode
* @param status True to check mlock on, false for mlock off
diff --git a/include/services.h b/include/services.h
index 8ec13d225..1c0c5f6ea 100644
--- a/include/services.h
+++ b/include/services.h
@@ -746,8 +746,7 @@ enum BadWordType
/* Structure used to contain bad words. */
struct BadWord
{
- uint16 in_use;
- char *word;
+ std::string word;
BadWordType type;
};