From dc751bd2f10ab498352ee8a64d2c4b0dcac7c4ea Mon Sep 17 00:00:00 2001 From: Adam Date: Sat, 22 Dec 2012 14:49:48 -0500 Subject: Combine all of the set modules now that having them split apart is almost completely pointless --- modules/extra/cs_statusupdate.cpp | 68 +++++++++++++++++++++++++++++++++++++++ modules/extra/m_statusupdate.cpp | 68 --------------------------------------- modules/extra/ns_maxemail.cpp | 7 ++-- 3 files changed, 70 insertions(+), 73 deletions(-) create mode 100644 modules/extra/cs_statusupdate.cpp delete mode 100644 modules/extra/m_statusupdate.cpp (limited to 'modules/extra') diff --git a/modules/extra/cs_statusupdate.cpp b/modules/extra/cs_statusupdate.cpp new file mode 100644 index 000000000..41ea8833e --- /dev/null +++ b/modules/extra/cs_statusupdate.cpp @@ -0,0 +1,68 @@ +/* + * (C) 2003-2012 Anope Team + * Contact us at team@anope.org + * + * Please read COPYING and README for further details. + */ + +#include "module.h" + +static struct ModeInfo +{ + Anope::string priv; + ChannelModeName name; +} modeInfo[] = { + { "AUTOOWNER", CMODE_OWNER }, + { "AUTOPROTECT", CMODE_PROTECT }, + { "AUTOOP", CMODE_OP }, + { "AUTOHALFOP", CMODE_HALFOP }, + { "AUTOVOICE", CMODE_VOICE }, + { "", CMODE_END } +}; + +class StatusUpdate : public Module +{ + public: + StatusUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, SUPPORTED) + { + this->SetAuthor("Anope"); + + Implementation i[] = { I_OnAccessAdd, I_OnAccessDel }; + ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); + } + + void OnAccessAdd(ChannelInfo *ci, CommandSource &, ChanAccess *access) anope_override + { + if (ci->c) + for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) + { + User *user = (*it)->user; + + if (access->Matches(user, user->Account())) + { + for (int i = 0; !modeInfo[i].priv.empty(); ++i) + if (!access->HasPriv(modeInfo[i].priv)) + ci->c->RemoveMode(NULL, modeInfo[i].name, user->nick); + ci->c->SetCorrectModes(user, true, false); + } + } + } + + void OnAccessDel(ChannelInfo *ci, CommandSource &, ChanAccess *access) anope_override + { + if (ci->c) + for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) + { + User *user = (*it)->user; + + if (access->Matches(user, user->Account())) + { + for (int i = 0; !modeInfo[i].priv.empty(); ++i) + if (access->HasPriv(modeInfo[i].priv)) + ci->c->RemoveMode(NULL, modeInfo[i].name, user->nick); + } + } + } +}; + +MODULE_INIT(StatusUpdate) diff --git a/modules/extra/m_statusupdate.cpp b/modules/extra/m_statusupdate.cpp deleted file mode 100644 index 41ea8833e..000000000 --- a/modules/extra/m_statusupdate.cpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - * (C) 2003-2012 Anope Team - * Contact us at team@anope.org - * - * Please read COPYING and README for further details. - */ - -#include "module.h" - -static struct ModeInfo -{ - Anope::string priv; - ChannelModeName name; -} modeInfo[] = { - { "AUTOOWNER", CMODE_OWNER }, - { "AUTOPROTECT", CMODE_PROTECT }, - { "AUTOOP", CMODE_OP }, - { "AUTOHALFOP", CMODE_HALFOP }, - { "AUTOVOICE", CMODE_VOICE }, - { "", CMODE_END } -}; - -class StatusUpdate : public Module -{ - public: - StatusUpdate(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, SUPPORTED) - { - this->SetAuthor("Anope"); - - Implementation i[] = { I_OnAccessAdd, I_OnAccessDel }; - ModuleManager::Attach(i, this, sizeof(i) / sizeof(Implementation)); - } - - void OnAccessAdd(ChannelInfo *ci, CommandSource &, ChanAccess *access) anope_override - { - if (ci->c) - for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) - { - User *user = (*it)->user; - - if (access->Matches(user, user->Account())) - { - for (int i = 0; !modeInfo[i].priv.empty(); ++i) - if (!access->HasPriv(modeInfo[i].priv)) - ci->c->RemoveMode(NULL, modeInfo[i].name, user->nick); - ci->c->SetCorrectModes(user, true, false); - } - } - } - - void OnAccessDel(ChannelInfo *ci, CommandSource &, ChanAccess *access) anope_override - { - if (ci->c) - for (CUserList::iterator it = ci->c->users.begin(), it_end = ci->c->users.end(); it != it_end; ++it) - { - User *user = (*it)->user; - - if (access->Matches(user, user->Account())) - { - for (int i = 0; !modeInfo[i].priv.empty(); ++i) - if (access->HasPriv(modeInfo[i].priv)) - ci->c->RemoveMode(NULL, modeInfo[i].name, user->nick); - } - } - } -}; - -MODULE_INIT(StatusUpdate) diff --git a/modules/extra/ns_maxemail.cpp b/modules/extra/ns_maxemail.cpp index 121da057b..356721e03 100644 --- a/modules/extra/ns_maxemail.cpp +++ b/modules/extra/ns_maxemail.cpp @@ -1,5 +1,5 @@ -/* ns_maxemail.c - Limit the amount of times an email address - * can be used for a NickServ account. +/* ns_maxemail.cpp - Limit the amount of times an email address + * can be used for a NickServ account. * * (C) 2003-2012 Anope Team * Contact us at team@anope.org @@ -8,9 +8,6 @@ * Anope Coder: GeniusDex * * Please read COPYING and README for further details. - * - * Send any bug reports to the Anope Coder, as he will be able - * to deal with it best. */ #include "module.h" -- cgit