From 1b24c96ab07d99e5d95ec9337e7b541696b91eb3 Mon Sep 17 00:00:00 2001 From: Adam Date: Thu, 31 Dec 2015 13:01:18 -0500 Subject: Rename haader file names to be consistent with module names --- include/modules/botserv/badwords.h | 102 ++++++++++++++++++++++++++++ include/modules/botserv/bot.h | 38 +++++++++++ include/modules/botserv/info.h | 21 ++++++ include/modules/botserv/kick.h | 132 ++++++++++++++++++++++++++++++++++++ include/modules/bs_badwords.h | 102 ---------------------------- include/modules/bs_bot.h | 38 ----------- include/modules/bs_info.h | 21 ------ include/modules/bs_kick.h | 132 ------------------------------------ include/modules/chanserv/access.h | 28 ++++++++ include/modules/chanserv/akick.h | 64 +++++++++++++++++ include/modules/chanserv/drop.h | 22 ++++++ include/modules/chanserv/entrymsg.h | 29 ++++++++ include/modules/chanserv/info.h | 24 +++++++ include/modules/chanserv/log.h | 44 ++++++++++++ include/modules/chanserv/mode.h | 123 +++++++++++++++++++++++++++++++++ include/modules/chanserv/set.h | 26 +++++++ include/modules/chanserv/set_misc.h | 25 +++++++ include/modules/chanserv/suspend.h | 53 +++++++++++++++ include/modules/cs_access.h | 28 -------- include/modules/cs_akick.h | 64 ----------------- include/modules/cs_drop.h | 22 ------ include/modules/cs_entrymsg.h | 29 -------- include/modules/cs_info.h | 24 ------- include/modules/cs_log.h | 44 ------------ include/modules/cs_mode.h | 123 --------------------------------- include/modules/cs_set.h | 26 ------- include/modules/cs_set_misc.h | 25 ------- include/modules/cs_suspend.h | 53 --------------- include/modules/hostserv/del.h | 20 ++++++ include/modules/hs_del.h | 20 ------ include/modules/nickserv/access.h | 22 ++++++ include/modules/nickserv/ajoin.h | 25 +++++++ include/modules/nickserv/cert.h | 66 ++++++++++++++++++ include/modules/nickserv/drop.h | 22 ++++++ include/modules/nickserv/group.h | 22 ++++++ include/modules/nickserv/info.h | 24 +++++++ include/modules/nickserv/set.h | 26 +++++++ include/modules/nickserv/set_misc.h | 25 +++++++ include/modules/nickserv/suspend.h | 53 +++++++++++++++ include/modules/nickserv/update.h | 21 ++++++ include/modules/ns_access.h | 22 ------ include/modules/ns_ajoin.h | 25 ------- include/modules/ns_cert.h | 66 ------------------ include/modules/ns_drop.h | 22 ------ include/modules/ns_group.h | 22 ------ include/modules/ns_info.h | 24 ------- include/modules/ns_set.h | 26 ------- include/modules/ns_set_misc.h | 25 ------- include/modules/ns_suspend.h | 53 --------------- include/modules/ns_update.h | 21 ------ include/modules/operserv/defcon.h | 21 ++++++ include/modules/operserv/dns.h | 72 ++++++++++++++++++++ include/modules/operserv/forbid.h | 56 +++++++++++++++ include/modules/operserv/ignore.h | 43 ++++++++++++ include/modules/operserv/info.h | 29 ++++++++ include/modules/operserv/news.h | 32 +++++++++ include/modules/operserv/session.h | 77 +++++++++++++++++++++ include/modules/os_defcon.h | 21 ------ include/modules/os_dns.h | 72 -------------------- include/modules/os_forbid.h | 56 --------------- include/modules/os_ignore.h | 43 ------------ include/modules/os_info.h | 29 -------- include/modules/os_news.h | 32 --------- include/modules/os_session.h | 77 --------------------- 64 files changed, 1387 insertions(+), 1387 deletions(-) create mode 100644 include/modules/botserv/badwords.h create mode 100644 include/modules/botserv/bot.h create mode 100644 include/modules/botserv/info.h create mode 100644 include/modules/botserv/kick.h delete mode 100644 include/modules/bs_badwords.h delete mode 100644 include/modules/bs_bot.h delete mode 100644 include/modules/bs_info.h delete mode 100644 include/modules/bs_kick.h create mode 100644 include/modules/chanserv/access.h create mode 100644 include/modules/chanserv/akick.h create mode 100644 include/modules/chanserv/drop.h create mode 100644 include/modules/chanserv/entrymsg.h create mode 100644 include/modules/chanserv/info.h create mode 100644 include/modules/chanserv/log.h create mode 100644 include/modules/chanserv/mode.h create mode 100644 include/modules/chanserv/set.h create mode 100644 include/modules/chanserv/set_misc.h create mode 100644 include/modules/chanserv/suspend.h delete mode 100644 include/modules/cs_access.h delete mode 100644 include/modules/cs_akick.h delete mode 100644 include/modules/cs_drop.h delete mode 100644 include/modules/cs_entrymsg.h delete mode 100644 include/modules/cs_info.h delete mode 100644 include/modules/cs_log.h delete mode 100644 include/modules/cs_mode.h delete mode 100644 include/modules/cs_set.h delete mode 100644 include/modules/cs_set_misc.h delete mode 100644 include/modules/cs_suspend.h create mode 100644 include/modules/hostserv/del.h delete mode 100644 include/modules/hs_del.h create mode 100644 include/modules/nickserv/access.h create mode 100644 include/modules/nickserv/ajoin.h create mode 100644 include/modules/nickserv/cert.h create mode 100644 include/modules/nickserv/drop.h create mode 100644 include/modules/nickserv/group.h create mode 100644 include/modules/nickserv/info.h create mode 100644 include/modules/nickserv/set.h create mode 100644 include/modules/nickserv/set_misc.h create mode 100644 include/modules/nickserv/suspend.h create mode 100644 include/modules/nickserv/update.h delete mode 100644 include/modules/ns_access.h delete mode 100644 include/modules/ns_ajoin.h delete mode 100644 include/modules/ns_cert.h delete mode 100644 include/modules/ns_drop.h delete mode 100644 include/modules/ns_group.h delete mode 100644 include/modules/ns_info.h delete mode 100644 include/modules/ns_set.h delete mode 100644 include/modules/ns_set_misc.h delete mode 100644 include/modules/ns_suspend.h delete mode 100644 include/modules/ns_update.h create mode 100644 include/modules/operserv/defcon.h create mode 100644 include/modules/operserv/dns.h create mode 100644 include/modules/operserv/forbid.h create mode 100644 include/modules/operserv/ignore.h create mode 100644 include/modules/operserv/info.h create mode 100644 include/modules/operserv/news.h create mode 100644 include/modules/operserv/session.h delete mode 100644 include/modules/os_defcon.h delete mode 100644 include/modules/os_dns.h delete mode 100644 include/modules/os_forbid.h delete mode 100644 include/modules/os_ignore.h delete mode 100644 include/modules/os_info.h delete mode 100644 include/modules/os_news.h delete mode 100644 include/modules/os_session.h (limited to 'include') diff --git a/include/modules/botserv/badwords.h b/include/modules/botserv/badwords.h new file mode 100644 index 000000000..87986ee62 --- /dev/null +++ b/include/modules/botserv/badwords.h @@ -0,0 +1,102 @@ +/* BotServ core functions + * + * (C) 2003-2014 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 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: + 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(const BadWordType &) anope_abstract; +}; + +static Serialize::TypeReference badword("BadWord"); + +struct BadWords : public Service +{ + BadWords(Module *me) : Service(me, "BadWords", "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(ChanServ::Channel *, const Anope::string &word, BadWordType type) anope_abstract; + + virtual std::vector 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; +}; + +static ServiceReference badwords("BadWords", "badwords"); + +namespace Event +{ + struct CoreExport BadWordEvents : 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; + }; +} + +template<> struct EventName { static constexpr const char *const name = "Badwords"; }; diff --git a/include/modules/botserv/bot.h b/include/modules/botserv/bot.h new file mode 100644 index 000000000..fe6534309 --- /dev/null +++ b/include/modules/botserv/bot.h @@ -0,0 +1,38 @@ +/* + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +namespace Event +{ + struct CoreExport BotCreate : Events + { + /** Called when a new bot is made + * @param bi The bot + */ + virtual void OnBotCreate(ServiceBot *bi) anope_abstract; + }; + + struct CoreExport BotChange : Events + { + /** Called when a bot is changed + * @param bi The bot + */ + virtual void OnBotChange(ServiceBot *bi) anope_abstract; + }; + + struct CoreExport BotDelete : Events + { + /** Called when a bot is deleted + * @param bi The bot + */ + virtual void OnBotDelete(ServiceBot *bi) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "OnBotCreate"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotChange"; }; +template<> struct EventName { static constexpr const char *const name = "OnBotDelete"; }; diff --git a/include/modules/botserv/info.h b/include/modules/botserv/info.h new file mode 100644 index 000000000..1ebd58c89 --- /dev/null +++ b/include/modules/botserv/info.h @@ -0,0 +1,21 @@ +/* + * + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +namespace Event +{ + struct CoreExport ServiceBotEvent : 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; + }; + extern CoreExport EventHandlers OnServiceBot; +} + +template<> struct EventName { static constexpr const char *const name = "OnServiceBot"; }; diff --git a/include/modules/botserv/kick.h b/include/modules/botserv/kick.h new file mode 100644 index 000000000..1346d7427 --- /dev/null +++ b/include/modules/botserv/kick.h @@ -0,0 +1,132 @@ +/* BotServ core functions + * + * (C) 2003-2014 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. + * + * + */ + +class KickerData : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + 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() anope_abstract; + virtual void SetDontKickOps(const bool &) anope_abstract; + + virtual bool GetDontKickVoices() anope_abstract; + virtual void SetDontKickVoices(const bool &) anope_abstract; +}; + +static Serialize::TypeReference kickerdata("KickerData"); + +inline KickerData *GetKickerData(ChanServ::Channel *ci) +{ + KickerData *kd = ci->GetRef(kickerdata); + if (!kd && kickerdata) + { + kd = kickerdata.Create(); + kd->SetChannel(ci); + } + return kd; +} + +namespace Event +{ + struct CoreExport BotBan : Events + { + /** Called when a bot places a ban + * @param u User being banned + * @param ci Channel the ban is placed on + * @param mask The mask being banned + */ + virtual void OnBotBan(User *u, ChanServ::Channel *ci, const Anope::string &mask) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "OnBotBan"; }; + diff --git a/include/modules/bs_badwords.h b/include/modules/bs_badwords.h deleted file mode 100644 index 87986ee62..000000000 --- a/include/modules/bs_badwords.h +++ /dev/null @@ -1,102 +0,0 @@ -/* BotServ core functions - * - * (C) 2003-2014 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 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: - 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(const BadWordType &) anope_abstract; -}; - -static Serialize::TypeReference badword("BadWord"); - -struct BadWords : public Service -{ - BadWords(Module *me) : Service(me, "BadWords", "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(ChanServ::Channel *, const Anope::string &word, BadWordType type) anope_abstract; - - virtual std::vector 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; -}; - -static ServiceReference badwords("BadWords", "badwords"); - -namespace Event -{ - struct CoreExport BadWordEvents : 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; - }; -} - -template<> struct EventName { static constexpr const char *const name = "Badwords"; }; diff --git a/include/modules/bs_bot.h b/include/modules/bs_bot.h deleted file mode 100644 index fe6534309..000000000 --- a/include/modules/bs_bot.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -namespace Event -{ - struct CoreExport BotCreate : Events - { - /** Called when a new bot is made - * @param bi The bot - */ - virtual void OnBotCreate(ServiceBot *bi) anope_abstract; - }; - - struct CoreExport BotChange : Events - { - /** Called when a bot is changed - * @param bi The bot - */ - virtual void OnBotChange(ServiceBot *bi) anope_abstract; - }; - - struct CoreExport BotDelete : Events - { - /** Called when a bot is deleted - * @param bi The bot - */ - virtual void OnBotDelete(ServiceBot *bi) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "OnBotCreate"; }; -template<> struct EventName { static constexpr const char *const name = "OnBotChange"; }; -template<> struct EventName { static constexpr const char *const name = "OnBotDelete"; }; diff --git a/include/modules/bs_info.h b/include/modules/bs_info.h deleted file mode 100644 index 1ebd58c89..000000000 --- a/include/modules/bs_info.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - * - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -namespace Event -{ - struct CoreExport ServiceBotEvent : 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; - }; - extern CoreExport EventHandlers OnServiceBot; -} - -template<> struct EventName { static constexpr const char *const name = "OnServiceBot"; }; diff --git a/include/modules/bs_kick.h b/include/modules/bs_kick.h deleted file mode 100644 index 1346d7427..000000000 --- a/include/modules/bs_kick.h +++ /dev/null @@ -1,132 +0,0 @@ -/* BotServ core functions - * - * (C) 2003-2014 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. - * - * - */ - -class KickerData : public Serialize::Object -{ - protected: - using Serialize::Object::Object; - - public: - 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() anope_abstract; - virtual void SetDontKickOps(const bool &) anope_abstract; - - virtual bool GetDontKickVoices() anope_abstract; - virtual void SetDontKickVoices(const bool &) anope_abstract; -}; - -static Serialize::TypeReference kickerdata("KickerData"); - -inline KickerData *GetKickerData(ChanServ::Channel *ci) -{ - KickerData *kd = ci->GetRef(kickerdata); - if (!kd && kickerdata) - { - kd = kickerdata.Create(); - kd->SetChannel(ci); - } - return kd; -} - -namespace Event -{ - struct CoreExport BotBan : Events - { - /** Called when a bot places a ban - * @param u User being banned - * @param ci Channel the ban is placed on - * @param mask The mask being banned - */ - virtual void OnBotBan(User *u, ChanServ::Channel *ci, const Anope::string &mask) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "OnBotBan"; }; - diff --git a/include/modules/chanserv/access.h b/include/modules/chanserv/access.h new file mode 100644 index 000000000..54eb3f353 --- /dev/null +++ b/include/modules/chanserv/access.h @@ -0,0 +1,28 @@ +/* + * + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +static Serialize::TypeReference accesschanaccess("AccessChanAccess"); +static Serialize::TypeReference flagschanaccess("FlagsChanAccess"); +static Serialize::TypeReference xopchanaccess("XOPChanAccess"); + +namespace Event +{ + struct CoreExport LevelChange : Events + { + /** Called when a level for a channel is changed + * @param source The source of the command + * @param ci The channel the level was changed on + * @param priv The privilege changed + * @param what The new level + */ + virtual void OnLevelChange(CommandSource &source, ChanServ::Channel *ci, const Anope::string &priv, int16_t what) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "OnLevelChange"; }; diff --git a/include/modules/chanserv/akick.h b/include/modules/chanserv/akick.h new file mode 100644 index 000000000..966dac15b --- /dev/null +++ b/include/modules/chanserv/akick.h @@ -0,0 +1,64 @@ +/* + * + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +#include "modules/nickserv.h" + + /* AutoKick data. */ +class CoreExport AutoKick : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + public: + virtual ~AutoKick() = default; + + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual Anope::string GetMask() anope_abstract; + virtual void SetMask(const Anope::string &) anope_abstract; + + virtual NickServ::Account *GetAccount() anope_abstract; + virtual void SetAccount(NickServ::Account *) anope_abstract; + + virtual Anope::string GetReason() anope_abstract; + virtual void SetReason(const Anope::string &) anope_abstract; + + virtual Anope::string GetCreator() anope_abstract; + virtual void SetCreator(const Anope::string &) anope_abstract; + + virtual time_t GetAddTime() anope_abstract; + virtual void SetAddTime(const time_t &) anope_abstract; + + virtual time_t GetLastUsed() anope_abstract; + virtual void SetLastUsed(const time_t &) anope_abstract; +}; + +static Serialize::TypeReference autokick("AutoKick"); + +namespace Event +{ + struct CoreExport Akick : Events + { + /** Called after adding an akick to a channel + * @param source The source of the command + * @param ci The channel + * @param ak The akick + */ + virtual void OnAkickAdd(CommandSource &source, ChanServ::Channel *ci, const AutoKick *ak) anope_abstract; + + /** Called before removing an akick from a channel + * @param source The source of the command + * @param ci The channel + * @param ak The akick + */ + virtual void OnAkickDel(CommandSource &source, ChanServ::Channel *ci, const AutoKick *ak) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "Akick"; }; diff --git a/include/modules/chanserv/drop.h b/include/modules/chanserv/drop.h new file mode 100644 index 000000000..db231059b --- /dev/null +++ b/include/modules/chanserv/drop.h @@ -0,0 +1,22 @@ +/* + * + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +namespace Event +{ + struct CoreExport ChanDrop : Events + { + /** Called right before a channel is dropped + * @param source The user dropping the channel + * @param ci The channel + */ + virtual EventReturn OnChanDrop(CommandSource &source, ChanServ::Channel *ci) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "OnChanDrop"; }; diff --git a/include/modules/chanserv/entrymsg.h b/include/modules/chanserv/entrymsg.h new file mode 100644 index 000000000..b5804068f --- /dev/null +++ b/include/modules/chanserv/entrymsg.h @@ -0,0 +1,29 @@ +/* + * (C) 2003-2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +class EntryMsg : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual Anope::string GetCreator() anope_abstract; + virtual void SetCreator(const Anope::string &) anope_abstract; + + virtual Anope::string GetMessage() anope_abstract; + virtual void SetMessage(const Anope::string &) anope_abstract; + + virtual time_t GetWhen() anope_abstract; + virtual void SetWhen(const time_t &) anope_abstract; +}; + +static Serialize::TypeReference entrymsg("EntryMsg"); + diff --git a/include/modules/chanserv/info.h b/include/modules/chanserv/info.h new file mode 100644 index 000000000..f80e3daf2 --- /dev/null +++ b/include/modules/chanserv/info.h @@ -0,0 +1,24 @@ +/* + * + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +namespace Event +{ + struct CoreExport ChanInfo : Events + { + /** Called when a user requests info for a channel + * @param source The user requesting info + * @param ci The channel the user is requesting info for + * @param info Data to show the user requesting information + * @param show_hidden true if we should show the user everything + */ + virtual void OnChanInfo(CommandSource &source, ChanServ::Channel *ci, InfoFormatter &info, bool show_hidden) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "OnChanInfo"; }; diff --git a/include/modules/chanserv/log.h b/include/modules/chanserv/log.h new file mode 100644 index 000000000..d940f5e87 --- /dev/null +++ b/include/modules/chanserv/log.h @@ -0,0 +1,44 @@ +/* ChanServ core functions + * + * (C) 2003-2014 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. + */ + +class LogSetting : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual Anope::string GetServiceName() anope_abstract; + virtual void SetServiceName(const Anope::string &) anope_abstract; + + virtual Anope::string GetCommandService() anope_abstract; + virtual void SetCommandService(const Anope::string &) anope_abstract; + + virtual Anope::string GetCommandName() anope_abstract; + virtual void SetCommandName(const Anope::string &) anope_abstract; + + virtual Anope::string GetMethod() anope_abstract; + virtual void SetMethod(const Anope::string &) anope_abstract; + + virtual Anope::string GetExtra() anope_abstract; + virtual void SetExtra(const Anope::string &) anope_abstract; + + virtual Anope::string GetCreator() anope_abstract; + virtual void SetCreator(const Anope::string &) anope_abstract; + + virtual time_t GetCreated() anope_abstract; + virtual void SetCreated(const time_t &) anope_abstract; +}; + +static Serialize::TypeReference logsetting("LogSetting"); + diff --git a/include/modules/chanserv/mode.h b/include/modules/chanserv/mode.h new file mode 100644 index 000000000..4c7965e2a --- /dev/null +++ b/include/modules/chanserv/mode.h @@ -0,0 +1,123 @@ +/* ChanServ core functions + * + * (C) 2003-2014 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. + */ + +class ModeLock : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual bool GetSet() anope_abstract; + virtual void SetSet(const bool &) anope_abstract; + + virtual Anope::string GetName() anope_abstract; + virtual void SetName(const Anope::string &) anope_abstract; + + virtual Anope::string GetParam() anope_abstract; + virtual void SetParam(const Anope::string &) anope_abstract; + + virtual Anope::string GetSetter() anope_abstract; + virtual void SetSetter(const Anope::string &) anope_abstract; + + virtual time_t GetCreated() anope_abstract; + virtual void SetCreated(const time_t &) anope_abstract; +}; + +static Serialize::TypeReference modelock("ModeLock"); + +class ModeLocks : public Service +{ + public: + ModeLocks(Module *me) : Service(me, "ModeLocks", "mlocks") { } + + typedef std::vector ModeList; + + /** Check if a mode is mlocked + * @param mode The mode + * @param An optional param + * @param status True to check mlock on, false for mlock off + * @return true on success, false on fail + */ + virtual bool HasMLock(ChanServ::Channel *, ChannelMode *mode, const Anope::string ¶m, bool status) const anope_abstract; + + /** Set a mlock + * @param mode The mode + * @param status True for mlock on, false for mlock off + * @param param An optional param arg for + mlocked modes + * @param setter Who is setting the mlock + * @param created When the mlock was created + * @return true on success, false on failure (module blocking) + */ + virtual bool SetMLock(ChanServ::Channel *, ChannelMode *mode, bool status, const Anope::string ¶m = "", Anope::string setter = "", time_t created = Anope::CurTime) anope_abstract; + + /** Remove a mlock + * @param mode The mode + * @param status True for mlock on, false for mlock off + * @param param The param of the mode, required if it is a list or status mode + * @return true on success, false on failure + */ + virtual bool RemoveMLock(ChanServ::Channel *, ChannelMode *mode, bool status, const Anope::string ¶m = "") anope_abstract; + + /** Clear all mlocks on the channel + */ + virtual void ClearMLock(ChanServ::Channel *) anope_abstract; + + /** Get all of the mlocks for this channel + * @return The mlocks + */ + virtual ModeList GetMLock(ChanServ::Channel *) const anope_abstract; + + /** Get a list of mode locks on a channel + * @param name The mode name to get a list of + * @return a list of mlocks for the given mode + */ + virtual std::list GetModeLockList(ChanServ::Channel *, const Anope::string &name) anope_abstract; + + /** Get details for a specific mlock + * @param mname The mode name + * @param An optional param to match with + * @return The MLock, if any + */ + virtual ModeLock *GetMLock(ChanServ::Channel *, const Anope::string &mname, const Anope::string ¶m = "") anope_abstract; + + /** Get the current mode locks as a string + * @param complete True to show mlock parameters as well + * @return A string of mode locks, eg: +nrt + */ + virtual Anope::string GetMLockAsString(ChanServ::Channel *, bool complete) const anope_abstract; +}; + +static ServiceReference mlocks("ModeLocks", "mlocks"); + +namespace Event +{ + struct CoreExport MLockEvents : Events + { + /** Called when a mode is about to be mlocked + * @param ci The channel the mode is being locked on + * @param lock The mode lock + * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock. + */ + virtual EventReturn OnMLock(ChanServ::Channel *ci, ModeLock *lock) anope_abstract; + + /** Called when a mode is about to be unlocked + * @param ci The channel the mode is being unlocked from + * @param lock The mode lock + * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock. + */ + virtual EventReturn OnUnMLock(ChanServ::Channel *ci, ModeLock *lock) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "MLock"; }; diff --git a/include/modules/chanserv/set.h b/include/modules/chanserv/set.h new file mode 100644 index 000000000..a0e81c888 --- /dev/null +++ b/include/modules/chanserv/set.h @@ -0,0 +1,26 @@ +/* + * + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +namespace Event +{ + struct CoreExport SetChannelOption : Events + { + /** Called when a chanserv/set command is used + * @param source The source of the command + * @param cmd The command + * @param ci The channel the command was used on + * @param setting The setting passed to the command. Probably ON/OFF. + * @return EVENT_ALLOW to bypass access checks, EVENT_STOP to halt immediately. + */ + virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChanServ::Channel *ci, const Anope::string &setting) anope_abstract; + }; + static EventHandlersReference OnSetChannelOption; +} + +template<> struct EventName { static constexpr const char *const name = "OnSetChannelOption"; }; diff --git a/include/modules/chanserv/set_misc.h b/include/modules/chanserv/set_misc.h new file mode 100644 index 000000000..65b92cc89 --- /dev/null +++ b/include/modules/chanserv/set_misc.h @@ -0,0 +1,25 @@ +/* + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + */ + +class CSMiscData : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual Anope::string GetName() anope_abstract; + virtual void SetName(const Anope::string &) anope_abstract; + + virtual Anope::string GetData() anope_abstract; + virtual void SetData(const Anope::string &) anope_abstract; +}; + +static Serialize::TypeReference csmiscdata("CSMiscData"); + diff --git a/include/modules/chanserv/suspend.h b/include/modules/chanserv/suspend.h new file mode 100644 index 000000000..27187ea09 --- /dev/null +++ b/include/modules/chanserv/suspend.h @@ -0,0 +1,53 @@ +/* + * (C) 2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +class CSSuspendInfo : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + virtual ChanServ::Channel *GetChannel() anope_abstract; + virtual void SetChannel(ChanServ::Channel *) anope_abstract; + + virtual Anope::string GetBy() anope_abstract; + virtual void SetBy(const Anope::string &) anope_abstract; + + virtual Anope::string GetReason() anope_abstract; + virtual void SetReason(const Anope::string &) anope_abstract; + + virtual time_t GetWhen() anope_abstract; + virtual void SetWhen(const time_t &) anope_abstract; + + virtual time_t GetExpires() anope_abstract; + virtual void SetExpires(const time_t &) anope_abstract; +}; + +static Serialize::TypeReference cssuspendinfo("CSSuspendInfo"); + +namespace Event +{ + struct CoreExport ChanSuspend : Events + { + /** Called when a channel is suspended + * @param ci The channel + */ + virtual void OnChanSuspend(ChanServ::Channel *ci) anope_abstract; + }; + struct CoreExport ChanUnsuspend : Events + { + /** Called when a channel is unsuspended + * @param ci The channel + */ + virtual void OnChanUnsuspend(ChanServ::Channel *ci) anope_abstract; + }; + extern CoreExport EventHandlers OnChanUnsuspend; +} + +template<> struct EventName { static constexpr const char *const name = "OnChanSuspend"; }; +template<> struct EventName { static constexpr const char *const name = "OnChanUnsuspend"; }; diff --git a/include/modules/cs_access.h b/include/modules/cs_access.h deleted file mode 100644 index 54eb3f353..000000000 --- a/include/modules/cs_access.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -static Serialize::TypeReference accesschanaccess("AccessChanAccess"); -static Serialize::TypeReference flagschanaccess("FlagsChanAccess"); -static Serialize::TypeReference xopchanaccess("XOPChanAccess"); - -namespace Event -{ - struct CoreExport LevelChange : Events - { - /** Called when a level for a channel is changed - * @param source The source of the command - * @param ci The channel the level was changed on - * @param priv The privilege changed - * @param what The new level - */ - virtual void OnLevelChange(CommandSource &source, ChanServ::Channel *ci, const Anope::string &priv, int16_t what) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "OnLevelChange"; }; diff --git a/include/modules/cs_akick.h b/include/modules/cs_akick.h deleted file mode 100644 index 966dac15b..000000000 --- a/include/modules/cs_akick.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -#include "modules/nickserv.h" - - /* AutoKick data. */ -class CoreExport AutoKick : public Serialize::Object -{ - protected: - using Serialize::Object::Object; - public: - virtual ~AutoKick() = default; - - virtual ChanServ::Channel *GetChannel() anope_abstract; - virtual void SetChannel(ChanServ::Channel *) anope_abstract; - - virtual Anope::string GetMask() anope_abstract; - virtual void SetMask(const Anope::string &) anope_abstract; - - virtual NickServ::Account *GetAccount() anope_abstract; - virtual void SetAccount(NickServ::Account *) anope_abstract; - - virtual Anope::string GetReason() anope_abstract; - virtual void SetReason(const Anope::string &) anope_abstract; - - virtual Anope::string GetCreator() anope_abstract; - virtual void SetCreator(const Anope::string &) anope_abstract; - - virtual time_t GetAddTime() anope_abstract; - virtual void SetAddTime(const time_t &) anope_abstract; - - virtual time_t GetLastUsed() anope_abstract; - virtual void SetLastUsed(const time_t &) anope_abstract; -}; - -static Serialize::TypeReference autokick("AutoKick"); - -namespace Event -{ - struct CoreExport Akick : Events - { - /** Called after adding an akick to a channel - * @param source The source of the command - * @param ci The channel - * @param ak The akick - */ - virtual void OnAkickAdd(CommandSource &source, ChanServ::Channel *ci, const AutoKick *ak) anope_abstract; - - /** Called before removing an akick from a channel - * @param source The source of the command - * @param ci The channel - * @param ak The akick - */ - virtual void OnAkickDel(CommandSource &source, ChanServ::Channel *ci, const AutoKick *ak) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "Akick"; }; diff --git a/include/modules/cs_drop.h b/include/modules/cs_drop.h deleted file mode 100644 index db231059b..000000000 --- a/include/modules/cs_drop.h +++ /dev/null @@ -1,22 +0,0 @@ -/* - * - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -namespace Event -{ - struct CoreExport ChanDrop : Events - { - /** Called right before a channel is dropped - * @param source The user dropping the channel - * @param ci The channel - */ - virtual EventReturn OnChanDrop(CommandSource &source, ChanServ::Channel *ci) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "OnChanDrop"; }; diff --git a/include/modules/cs_entrymsg.h b/include/modules/cs_entrymsg.h deleted file mode 100644 index b5804068f..000000000 --- a/include/modules/cs_entrymsg.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -class EntryMsg : public Serialize::Object -{ - protected: - using Serialize::Object::Object; - - public: - virtual ChanServ::Channel *GetChannel() anope_abstract; - virtual void SetChannel(ChanServ::Channel *) anope_abstract; - - virtual Anope::string GetCreator() anope_abstract; - virtual void SetCreator(const Anope::string &) anope_abstract; - - virtual Anope::string GetMessage() anope_abstract; - virtual void SetMessage(const Anope::string &) anope_abstract; - - virtual time_t GetWhen() anope_abstract; - virtual void SetWhen(const time_t &) anope_abstract; -}; - -static Serialize::TypeReference entrymsg("EntryMsg"); - diff --git a/include/modules/cs_info.h b/include/modules/cs_info.h deleted file mode 100644 index f80e3daf2..000000000 --- a/include/modules/cs_info.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -namespace Event -{ - struct CoreExport ChanInfo : Events - { - /** Called when a user requests info for a channel - * @param source The user requesting info - * @param ci The channel the user is requesting info for - * @param info Data to show the user requesting information - * @param show_hidden true if we should show the user everything - */ - virtual void OnChanInfo(CommandSource &source, ChanServ::Channel *ci, InfoFormatter &info, bool show_hidden) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "OnChanInfo"; }; diff --git a/include/modules/cs_log.h b/include/modules/cs_log.h deleted file mode 100644 index d940f5e87..000000000 --- a/include/modules/cs_log.h +++ /dev/null @@ -1,44 +0,0 @@ -/* ChanServ core functions - * - * (C) 2003-2014 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. - */ - -class LogSetting : public Serialize::Object -{ - protected: - using Serialize::Object::Object; - - public: - virtual ChanServ::Channel *GetChannel() anope_abstract; - virtual void SetChannel(ChanServ::Channel *) anope_abstract; - - virtual Anope::string GetServiceName() anope_abstract; - virtual void SetServiceName(const Anope::string &) anope_abstract; - - virtual Anope::string GetCommandService() anope_abstract; - virtual void SetCommandService(const Anope::string &) anope_abstract; - - virtual Anope::string GetCommandName() anope_abstract; - virtual void SetCommandName(const Anope::string &) anope_abstract; - - virtual Anope::string GetMethod() anope_abstract; - virtual void SetMethod(const Anope::string &) anope_abstract; - - virtual Anope::string GetExtra() anope_abstract; - virtual void SetExtra(const Anope::string &) anope_abstract; - - virtual Anope::string GetCreator() anope_abstract; - virtual void SetCreator(const Anope::string &) anope_abstract; - - virtual time_t GetCreated() anope_abstract; - virtual void SetCreated(const time_t &) anope_abstract; -}; - -static Serialize::TypeReference logsetting("LogSetting"); - diff --git a/include/modules/cs_mode.h b/include/modules/cs_mode.h deleted file mode 100644 index 4c7965e2a..000000000 --- a/include/modules/cs_mode.h +++ /dev/null @@ -1,123 +0,0 @@ -/* ChanServ core functions - * - * (C) 2003-2014 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. - */ - -class ModeLock : public Serialize::Object -{ - protected: - using Serialize::Object::Object; - - public: - virtual ChanServ::Channel *GetChannel() anope_abstract; - virtual void SetChannel(ChanServ::Channel *) anope_abstract; - - virtual bool GetSet() anope_abstract; - virtual void SetSet(const bool &) anope_abstract; - - virtual Anope::string GetName() anope_abstract; - virtual void SetName(const Anope::string &) anope_abstract; - - virtual Anope::string GetParam() anope_abstract; - virtual void SetParam(const Anope::string &) anope_abstract; - - virtual Anope::string GetSetter() anope_abstract; - virtual void SetSetter(const Anope::string &) anope_abstract; - - virtual time_t GetCreated() anope_abstract; - virtual void SetCreated(const time_t &) anope_abstract; -}; - -static Serialize::TypeReference modelock("ModeLock"); - -class ModeLocks : public Service -{ - public: - ModeLocks(Module *me) : Service(me, "ModeLocks", "mlocks") { } - - typedef std::vector ModeList; - - /** Check if a mode is mlocked - * @param mode The mode - * @param An optional param - * @param status True to check mlock on, false for mlock off - * @return true on success, false on fail - */ - virtual bool HasMLock(ChanServ::Channel *, ChannelMode *mode, const Anope::string ¶m, bool status) const anope_abstract; - - /** Set a mlock - * @param mode The mode - * @param status True for mlock on, false for mlock off - * @param param An optional param arg for + mlocked modes - * @param setter Who is setting the mlock - * @param created When the mlock was created - * @return true on success, false on failure (module blocking) - */ - virtual bool SetMLock(ChanServ::Channel *, ChannelMode *mode, bool status, const Anope::string ¶m = "", Anope::string setter = "", time_t created = Anope::CurTime) anope_abstract; - - /** Remove a mlock - * @param mode The mode - * @param status True for mlock on, false for mlock off - * @param param The param of the mode, required if it is a list or status mode - * @return true on success, false on failure - */ - virtual bool RemoveMLock(ChanServ::Channel *, ChannelMode *mode, bool status, const Anope::string ¶m = "") anope_abstract; - - /** Clear all mlocks on the channel - */ - virtual void ClearMLock(ChanServ::Channel *) anope_abstract; - - /** Get all of the mlocks for this channel - * @return The mlocks - */ - virtual ModeList GetMLock(ChanServ::Channel *) const anope_abstract; - - /** Get a list of mode locks on a channel - * @param name The mode name to get a list of - * @return a list of mlocks for the given mode - */ - virtual std::list GetModeLockList(ChanServ::Channel *, const Anope::string &name) anope_abstract; - - /** Get details for a specific mlock - * @param mname The mode name - * @param An optional param to match with - * @return The MLock, if any - */ - virtual ModeLock *GetMLock(ChanServ::Channel *, const Anope::string &mname, const Anope::string ¶m = "") anope_abstract; - - /** Get the current mode locks as a string - * @param complete True to show mlock parameters as well - * @return A string of mode locks, eg: +nrt - */ - virtual Anope::string GetMLockAsString(ChanServ::Channel *, bool complete) const anope_abstract; -}; - -static ServiceReference mlocks("ModeLocks", "mlocks"); - -namespace Event -{ - struct CoreExport MLockEvents : Events - { - /** Called when a mode is about to be mlocked - * @param ci The channel the mode is being locked on - * @param lock The mode lock - * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock. - */ - virtual EventReturn OnMLock(ChanServ::Channel *ci, ModeLock *lock) anope_abstract; - - /** Called when a mode is about to be unlocked - * @param ci The channel the mode is being unlocked from - * @param lock The mode lock - * @return EVENT_CONTINUE to let other modules decide, EVENT_STOP to deny the mlock. - */ - virtual EventReturn OnUnMLock(ChanServ::Channel *ci, ModeLock *lock) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "MLock"; }; diff --git a/include/modules/cs_set.h b/include/modules/cs_set.h deleted file mode 100644 index a0e81c888..000000000 --- a/include/modules/cs_set.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -namespace Event -{ - struct CoreExport SetChannelOption : Events - { - /** Called when a chanserv/set command is used - * @param source The source of the command - * @param cmd The command - * @param ci The channel the command was used on - * @param setting The setting passed to the command. Probably ON/OFF. - * @return EVENT_ALLOW to bypass access checks, EVENT_STOP to halt immediately. - */ - virtual EventReturn OnSetChannelOption(CommandSource &source, Command *cmd, ChanServ::Channel *ci, const Anope::string &setting) anope_abstract; - }; - static EventHandlersReference OnSetChannelOption; -} - -template<> struct EventName { static constexpr const char *const name = "OnSetChannelOption"; }; diff --git a/include/modules/cs_set_misc.h b/include/modules/cs_set_misc.h deleted file mode 100644 index 65b92cc89..000000000 --- a/include/modules/cs_set_misc.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -class CSMiscData : public Serialize::Object -{ - protected: - using Serialize::Object::Object; - - public: - virtual ChanServ::Channel *GetChannel() anope_abstract; - virtual void SetChannel(ChanServ::Channel *) anope_abstract; - - virtual Anope::string GetName() anope_abstract; - virtual void SetName(const Anope::string &) anope_abstract; - - virtual Anope::string GetData() anope_abstract; - virtual void SetData(const Anope::string &) anope_abstract; -}; - -static Serialize::TypeReference csmiscdata("CSMiscData"); - diff --git a/include/modules/cs_suspend.h b/include/modules/cs_suspend.h deleted file mode 100644 index 27187ea09..000000000 --- a/include/modules/cs_suspend.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * (C) 2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - * - */ - -class CSSuspendInfo : public Serialize::Object -{ - protected: - using Serialize::Object::Object; - - public: - virtual ChanServ::Channel *GetChannel() anope_abstract; - virtual void SetChannel(ChanServ::Channel *) anope_abstract; - - virtual Anope::string GetBy() anope_abstract; - virtual void SetBy(const Anope::string &) anope_abstract; - - virtual Anope::string GetReason() anope_abstract; - virtual void SetReason(const Anope::string &) anope_abstract; - - virtual time_t GetWhen() anope_abstract; - virtual void SetWhen(const time_t &) anope_abstract; - - virtual time_t GetExpires() anope_abstract; - virtual void SetExpires(const time_t &) anope_abstract; -}; - -static Serialize::TypeReference cssuspendinfo("CSSuspendInfo"); - -namespace Event -{ - struct CoreExport ChanSuspend : Events - { - /** Called when a channel is suspended - * @param ci The channel - */ - virtual void OnChanSuspend(ChanServ::Channel *ci) anope_abstract; - }; - struct CoreExport ChanUnsuspend : Events - { - /** Called when a channel is unsuspended - * @param ci The channel - */ - virtual void OnChanUnsuspend(ChanServ::Channel *ci) anope_abstract; - }; - extern CoreExport EventHandlers OnChanUnsuspend; -} - -template<> struct EventName { static constexpr const char *const name = "OnChanSuspend"; }; -template<> struct EventName { static constexpr const char *const name = "OnChanUnsuspend"; }; diff --git a/include/modules/hostserv/del.h b/include/modules/hostserv/del.h new file mode 100644 index 000000000..9b2ea39ef --- /dev/null +++ b/include/modules/hostserv/del.h @@ -0,0 +1,20 @@ +/* + * + * (C) 2003-2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + */ + +namespace Event +{ + struct CoreExport DeleteVhost : Events + { + /** Called when a vhost is deleted + * @param na The nickalias of the vhost + */ + virtual void OnDeleteVhost(NickServ::Nick *na) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "OnDeleteVhost"; }; diff --git a/include/modules/hs_del.h b/include/modules/hs_del.h deleted file mode 100644 index 9b2ea39ef..000000000 --- a/include/modules/hs_del.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * - * (C) 2003-2014 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -namespace Event -{ - struct CoreExport DeleteVhost : Events - { - /** Called when a vhost is deleted - * @param na The nickalias of the vhost - */ - virtual void OnDeleteVhost(NickServ::Nick *na) anope_abstract; - }; -} - -template<> struct EventName { static constexpr const char *const name = "OnDeleteVhost"; }; diff --git a/include/modules/nickserv/access.h b/include/modules/nickserv/access.h new file mode 100644 index 000000000..73a625f3d --- /dev/null +++ b/include/modules/nickserv/access.h @@ -0,0 +1,22 @@ +/* + * + * (C) 2003-2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + */ + +class NickAccess : public Serialize::Object +{ + public: + using Serialize::Object::Object; + + virtual NickServ::Account *GetAccount() anope_abstract; + virtual void SetAccount(NickServ::Account *) anope_abstract; + + virtual Anope::string GetMask() anope_abstract; + virtual void SetMask(const Anope::string &) anope_abstract; +}; + +static Serialize::TypeReference nsaccess("NSAccess"); + diff --git a/include/modules/nickserv/ajoin.h b/include/modules/nickserv/ajoin.h new file mode 100644 index 000000000..7b4cc20e5 --- /dev/null +++ b/include/modules/nickserv/ajoin.h @@ -0,0 +1,25 @@ +/* + * + * (C) 2013-2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + */ + +class AutoJoin : public Serialize::Object +{ + protected: + using Serialize::Object::Object; + + public: + virtual NickServ::Account *GetOwner() anope_abstract; + virtual void SetOwner(NickServ::Account *acc) anope_abstract; + + virtual Anope::string GetChannel() anope_abstract; + virtual void SetChannel(const Anope::string &c) anope_abstract; + + virtual Anope::string GetKey() anope_abstract; + virtual void SetKey(const Anope::string &k) anope_abstract; +}; + +static Serialize::TypeReference autojoin("AutoJoin"); diff --git a/include/modules/nickserv/cert.h b/include/modules/nickserv/cert.h new file mode 100644 index 000000000..be75fb9bf --- /dev/null +++ b/include/modules/nickserv/cert.h @@ -0,0 +1,66 @@ +/* NickServ core functions + * + * (C) 2003-2014 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. + */ + +class NSCertEntry; + +class CertService : public Service +{ + public: + CertService(Module *c) : Service(c, "CertService", "certs") { } + + virtual NickServ::Account* FindAccountFromCert(const Anope::string &cert) anope_abstract; + + virtual bool Matches(User *, NickServ::Account *) anope_abstract; + + virtual NSCertEntry *FindCert(const std::vector &cl, const Anope::string &certfp) anope_abstract; +}; + +static ServiceReference certservice("CertService", "certs"); + +class NSCertEntry : public Serialize::Object +{ + public: + using Serialize::Object::Object; + + virtual NickServ::Account *GetAccount() anope_abstract; + virtual void SetAccount(NickServ::Account *) anope_abstract; + + virtual Anope::string GetCert() anope_abstract; + virtual void SetCert(const Anope::string &) anope_abstract; +}; + +static Serialize::TypeReference certentry("NSCertEntry"); + +namespace Event +{ + struct CoreExport NickCertEvents : Events + { + /** Called when a user adds an entry to their cert list + * @param nc The nick + * @param entry The entry + */ + virtual void OnNickAddCert(NickServ::Account *nc, const Anope::string &entry) anope_abstract; + + /** Called from NickServ::Account::EraseCert() + * @param nc pointer to the NickServ::Account + * @param entry The fingerprint + */ + virtual void OnNickEraseCert(NickServ::Account *nc, const Anope::string &entry) anope_abstract; + + /** called from NickServ::Account::ClearCert() + * @param nc pointer to the NickServ::Account + */ + virtual void OnNickClearCert(NickServ::Account *nc) anope_abstract; + }; +} + + +template<> struct EventName { static constexpr const char *const name = "OnNickCert"; }; diff --git a/include/modules/nickserv/drop.h b/include/modules/nickserv/drop.h new file mode 100644 index 000000000..bae9d77b6 --- /dev/null +++ b/include/modules/nickserv/drop.h @@ -0,0 +1,22 @@ +/* + * + * (C) 2003-2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + */ + +namespace Event +{ + struct CoreExport NickDrop : Events + { + /** Called when a nick is dropped + * @param source The source of the command + * @param na The nick + */ + virtual void OnNickDrop(CommandSource &source, NickServ::Nick *na) anope_abstract; + }; + extern CoreExport EventHandlers OnNickDrop; +} + +template<> struct EventName { static constexpr const char *const name = "OnNickDrop"; }; diff --git a/include/modules/nickserv/group.h b/include/modules/nickserv/group.h new file mode 100644 index 000000000..caa568a9e --- /dev/null +++ b/include/modules/nickserv/group.h @@ -0,0 +1,22 @@ +/* + * + * (C) 2003-2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +namespace Event +{ + struct CoreExport NickGroup : Events + { + /** Called when a user groups their nick + * @param u The user grouping + * @param target The target they're grouping to + */ + virtual void OnNickGroup(User *u, NickServ::Nick *target) anope_abstract; + }; +} + +template<> struct EventName { static constexpr const char *const name = "OnNickGroup"; }; diff --git a/include/modules/nickserv/info.h b/include/modules/nickserv/info.h new file mode 100644 index 000000000..e816cc356 --- /dev/null +++ b/include/modules/nickserv/info.h @@ -0,0 +1,24 @@ +/* + * + * (C) 2003-2014 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + * + */ + +namespace Event +{ + struct CoreExport NickInfo : Events + { + /** Called when a user requests info for a nick + * @param source The user requesting info + * @param na The nick the user is requesting info from + * @param info Data to show the user requesting information + * @param show_hidden true if we should show the user everything + */ + virtual void OnNickInfo(Comma