diff options
Diffstat (limited to 'include/modules')
83 files changed, 6347 insertions, 1002 deletions
diff --git a/include/modules/botserv.h b/include/modules/botserv.h new file mode 100644 index 000000000..17422d0ae --- /dev/null +++ b/include/modules/botserv.h @@ -0,0 +1,32 @@ +/* + * Anope IRC Services + * + * Copyright (C) 2014-2017 Anope Team <team@anope.org> + * + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. + */ + +#pragma once + +namespace BotServ +{ + class BotServService : public Service + { + public: + BotServService(Module *m) : Service(m, "BotServService", "BotServ") + { + } + + }; +} diff --git a/include/modules/botserv/badwords.h b/include/modules/botserv/badwords.h new file mode 100644 index 000000000..69c68e6b4 --- /dev/null +++ b/include/modules/botserv/badwords.h @@ -0,0 +1,112 @@ +/* + * Anope IRC Services + * + * Copyright (C) 2013-2017 Anope Team <team@anope.org> + * + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. + */ + +/** Flags for badwords + */ +enum BadWordType +{ + /* Always kicks if the word is said */ + BW_ANY, + /* User must say 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. */ +class BadWord : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + public: + static constexpr const char *NAME = "badword"; + + virtual ~BadWord() = default; + + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual Anope::string GetWord() anope_abstract; + virtual void SetWord(const Anope::string &) anope_abstract; + + virtual BadWordType GetType() anope_abstract; + virtual void SetType(BadWordType) anope_abstract; +}; + +class BadWords : public Service +{ + public: + static constexpr const char *NAME = "badwords"; + + BadWords(Module *me) : Service(me, NAME) { } + + /** Add a badword to the badword list + * @param word The badword + * @param type The type (SINGLE START END) + * @return The badword + */ + virtual BadWord* AddBadWord(ChanServ::Channel *, const Anope::string &word, BadWordType type) anope_abstract; + + virtual std::vector<BadWord *> GetBadWords(ChanServ::Channel *ci) anope_abstract; + + /** Get a badword structure by index + * @param index The index + * @return The badword + */ + virtual BadWord* GetBadWord(ChanServ::Channel *, unsigned index) anope_abstract; + + /** Get how many badwords are on this channel + * @return The number of badwords in the vector + */ + virtual unsigned GetBadWordCount(ChanServ::Channel *) anope_abstract; + + /** Remove a badword + * @param index The index of the badword + */ + virtual void EraseBadWord(ChanServ::Channel *, unsigned index) anope_abstract; + + /** Clear all badwords from the channel + */ + virtual void ClearBadWords(ChanServ::Channel *) anope_abstract; +}; + +namespace Event +{ + struct CoreExport BadWordEvents : Events + { + static constexpr const char *NAME = "badwords"; + + using Events::Events; + + /** Called before a badword is added to the badword list + * @param ci The channel + * @param bw The badword + */ + virtual void OnBadWordAdd(ChanServ::Channel *ci, const BadWord *bw) anope_abstract; + + /** Called before a badword is deleted from a channel + * @param ci The channel + * @param bw The badword + */ + virtual void OnBadWordDel(ChanServ::Channel *ci, const BadWord *bw) anope_abstract; + }; +} + diff --git a/include/modules/botserv/bot.h b/include/modules/botserv/bot.h new file mode 100644 index 000000000..9ee5254a7 --- /dev/null +++ b/include/modules/botserv/bot.h @@ -0,0 +1,58 @@ +/* + * Anope IRC Services + * + * Copyright (C) 2014-2017 Anope Team <team@anope.org> + * + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. + */ + +namespace Event +{ + struct CoreExport BotCreate : Events + { + static constexpr const char *NAME = "botcreate"; + + using Events::Events; + + /** Called when a new bot is made + * @param bi The bot + */ + virtual void OnBotCreate(ServiceBot *bi) anope_abstract; + }; + + struct CoreExport BotChange : Events + { + static constexpr const char *NAME = "botchange"; + + using Events::Events; + + /** Called when a bot is changed + * @param bi The bot + */ + virtual void OnBotChange(ServiceBot *bi) anope_abstract; + }; + + struct CoreExport BotDelete : Events + { + static constexpr const char *NAME = "botdelete"; + + using Events::Events; + + /** Called when a bot is deleted + * @param bi The bot + */ + virtual void OnBotDelete(ServiceBot *bi) anope_abstract; + }; +} + diff --git a/include/modules/botserv/info.h b/include/modules/botserv/info.h new file mode 100644 index 000000000..428110f9a --- /dev/null +++ b/include/modules/botserv/info.h @@ -0,0 +1,33 @@ +/* + * Anope IRC Services + * + * Copyright (C) 2014-2017 Anope Team <team@anope.org> + * + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. + */ + +namespace Event +{ + struct CoreExport ServiceBotEvent : Events + { + static constexpr const char *NAME = "servicebotevent"; + + using Events::Events; + + /** Called when a user uses botserv/info on a bot or channel. + */ + virtual void OnServiceBot(CommandSource &source, ServiceBot *bi, ChanServ::Channel *ci, InfoFormatter &info) anope_abstract; + }; +} + diff --git a/include/modules/botserv/kick.h b/include/modules/botserv/kick.h new file mode 100644 index 000000000..20b90ad08 --- /dev/null +++ b/include/modules/botserv/kick.h @@ -0,0 +1,141 @@ +/* + * Anope IRC Services + * + * Copyright (C) 2013-2017 Anope Team <team@anope.org> + * + * This file is part of Anope. Anope is free software; you can + * redistribute it and/or modify it under the terms of the GNU + * General Public License as published by the Free Software + * Foundation, version 2. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, see see <http://www.gnu.org/licenses/>. + */ +class KickerData : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + static constexpr const char *const NAME = "kickerdata"; + + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual bool GetAmsgs() anope_abstract; + virtual void SetAmsgs(const bool &) anope_abstract; + + virtual bool GetBadwords() anope_abstract; + virtual void SetBadwords(const bool &) anope_abstract; + + virtual bool GetBolds() anope_abstract; + virtual void SetBolds(const bool &) anope_abstract; + + virtual bool GetCaps() anope_abstract; + virtual void SetCaps(const bool &) anope_abstract; + + virtual bool GetColors() anope_abstract; + virtual void SetColors(const bool &) anope_abstract; + + virtual bool GetFlood() anope_abstract; + virtual void SetFlood(const bool &) anope_abstract; + + virtual bool GetItalics() anope_abstract; + virtual void SetItalics(const bool &) anope_abstract; + + virtual bool GetRepeat() anope_abstract; + virtual void SetRepeat(const bool &) anope_abstract; + + virtual bool GetReverses() anope_abstract; + virtual void SetReverses(const bool &) anope_abstract; + + virtual bool GetUnderlines() anope_abstract; + virtual void SetUnderlines(const bool &) anope_abstract; + + virtual int16_t GetTTBBolds() anope_abstract; + virtual void SetTTBBolds(const int16_t &) anope_abstract; + + virtual int16_t GetTTBColors() anope_abstract; + virtual void SetTTBColors(const int16_t &) anope_abstract; + + virtual int16_t GetTTBReverses() anope_abstract; + virtual void SetTTBReverses(const int16_t &) anope_abstract; + + virtual int16_t GetTTBUnderlines() anope_abstract; + virtual void SetTTBUnderlines(const int16_t &) anope_abstract; + + virtual int16_t GetTTBBadwords() anope_abstract; + virtual void SetTTBBadwords(const int16_t &) anope_abstract; + + virtual int16_t GetTTBCaps() anope_abstract; + virtual void SetTTBCaps(const int16_t &) anope_abstract; + + virtual int16_t GetTTBFlood() anope_abstract; + virtual void SetTTBFlood(const int16_t &) anope_abstract; + + virtual int16_t GetTTBRepeat() anope_abstract; + virtual void SetTTBRepeat(const int16_t &) anope_abstract; + + virtual int16_t GetTTBItalics() anope_abstract; + virtual void SetTTBItalics(const int16_t &) anope_abstract; + + virtual int16_t GetTTBAmsgs() anope_abstract; + virtual void SetTTBAmsgs(const int16_t &) anope_abstract; + + virtual int16_t GetCapsMin() anope_abstract; + virtual void SetCapsMin(const int16_t &) anope_abstract; + + virtual int16_t GetCapsPercent() anope_abstract; + virtual void SetCapsPercent(const int16_t &) anope_abstract; + + virtual int16_t GetFloodLines() anope_abstract; + virtual void SetFloodLines(const int16_t &) anope_abstract; + + virtual int16_t GetFloodSecs() anope_abstract; + virtual void SetFloodSecs(const int16_t &) anope_abstract; + + virtual int16_t GetRepeatTimes() anope_abstract; + virtual void SetRepeatTimes(const int16_t &) anope_abstract; + + virtual bool GetDontKickOps( |
