diff options
author | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-07-01 22:17:52 -0400 |
commit | 1a3d9a016d3adc49788bbff73aac9b3b5ea85b17 (patch) | |
tree | c0ecf92ed768473bc82ff64a7fce827245f37ba9 /include/modules/bs_badwords.h | |
parent | 518182ac9204f815258b0de91b3f884d8efa1502 (diff) |
Change extensible keys to require explicitly having a type defined for it. Completely modularize more features like bs_kick, entrymsg, log, mode, etc. Move fantasy to its own module. Move greet to its own module.
Diffstat (limited to 'include/modules/bs_badwords.h')
-rw-r--r-- | include/modules/bs_badwords.h | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h new file mode 100644 index 000000000..4275226cc --- /dev/null +++ b/include/modules/bs_badwords.h @@ -0,0 +1,70 @@ +/* BotServ core functions + * + * (C) 2003-2013 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * + */ + +/** Flags for badwords + */ +enum BadWordType +{ + /* Always kicks if the word is said */ + BW_ANY, + /* User must way the entire word */ + BW_SINGLE, + /* The word has to start with the badword */ + BW_START, + /* The word has to end with the badword */ + BW_END +}; + +/* Structure used to contain bad words. */ +struct BadWord +{ + Anope::string chan; + Anope::string word; + BadWordType type; + + protected: + BadWord() { } +}; + +struct BadWords +{ + /** Add a badword to the badword list + * @param word The badword + * @param type The type (SINGLE START END) + * @return The badword + */ + virtual BadWord* AddBadWord(const Anope::string &word, BadWordType type) = 0; + + /** Get a badword structure by index + * @param index The index + * @return The badword + */ + virtual BadWord* GetBadWord(unsigned index) const = 0; + + /** Get how many badwords are on this channel + * @return The number of badwords in the vector + */ + virtual unsigned GetBadWordCount() const = 0; + + /** Remove a badword + * @param index The index of the badword + */ + virtual void EraseBadWord(unsigned index) = 0; + + /** Clear all badwords from the channel + */ + virtual void ClearBadWords() = 0; + + virtual void Check() = 0; +}; + |