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:
+30
-4
@@ -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
@@ -746,8 +746,7 @@ enum BadWordType
|
||||
/* Structure used to contain bad words. */
|
||||
struct BadWord
|
||||
{
|
||||
uint16 in_use;
|
||||
char *word;
|
||||
std::string word;
|
||||
BadWordType type;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user