1
0
mirror of https://github.com/anope/anope.git synced 2026-07-03 15:13:14 +02:00

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
This commit is contained in:
Adam-
2009-11-17 03:15:31 +00:00
parent 88c0edc8f8
commit 88330c07ad
6 changed files with 207 additions and 207 deletions
+30 -4
View File
@@ -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
+1 -2
View File
@@ -746,8 +746,7 @@ enum BadWordType
/* Structure used to contain bad words. */
struct BadWord
{
uint16 in_use;
char *word;
std::string word;
BadWordType type;
};