diff options
author | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-29 16:28:37 +0000 |
---|---|---|
committer | w00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7> | 2008-07-29 16:28:37 +0000 |
commit | 5db3290d939509015167b7fdfba5073285051560 (patch) | |
tree | 5a3afea4313d9549a26f32b5fe7980dc2e973831 | |
parent | 16f8c2df7e9f1e35466d8102a05893fb41f2f404 (diff) |
After discussions and thought, move umode +n to +s. This increases cross-ircd compat (both charybdis and unreal use +s for snomasks, others might in the future). This also decreases complexity for new users, and removes the redundancy. This means that just +s +cC for example will be required to view connects. (files to be renamed in next commit to not confuse svn).
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@10074 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | include/modes/umode_s.h | 25 | ||||
-rw-r--r-- | include/users.h | 8 | ||||
-rw-r--r-- | src/mode.cpp | 5 | ||||
-rw-r--r-- | src/modes/Makefile | 7 | ||||
-rw-r--r-- | src/modes/umode_n.cpp | 9 | ||||
-rw-r--r-- | src/modes/umode_s.cpp | 27 | ||||
-rw-r--r-- | src/snomasks.cpp | 2 |
7 files changed, 8 insertions, 75 deletions
diff --git a/include/modes/umode_s.h b/include/modes/umode_s.h deleted file mode 100644 index 4747b15d0..000000000 --- a/include/modes/umode_s.h +++ /dev/null @@ -1,25 +0,0 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ - * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits - * - * This program is free but copyrighted software; see - * the file COPYING for details. - * - * --------------------------------------------------- - */ - -#include "mode.h" - -class InspIRCd; - -/** User mode +s - */ -class ModeUserServerNotice : public SimpleUserModeHandler -{ - public: - ModeUserServerNotice(InspIRCd* Instance); - unsigned int GetCount(); -}; diff --git a/include/users.h b/include/users.h index b3de65941..ac06f75f5 100644 --- a/include/users.h +++ b/include/users.h @@ -44,16 +44,14 @@ enum ClassTypes { /** RFC1459 channel modes */ enum UserModes { - /** +s: Server notices */ - UM_SERVERNOTICE = 's' - 65, + /** +s: Server notice mask */ + UM_SNOMASK = 's' - 65, /** +w: WALLOPS */ UM_WALLOPS = 'w' - 65, /** +i: Invisible */ UM_INVISIBLE = 'i' - 65, /** +o: Operator */ - UM_OPERATOR = 'o' - 65, - /** +n: Server notice mask */ - UM_SNOMASK = 'n' - 65 + UM_OPERATOR = 'o' - 65 }; /** Registration state of a user, e.g. diff --git a/src/mode.cpp b/src/mode.cpp index faa70a29f..509ec738a 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -43,15 +43,13 @@ #include "modes/cmode_h.h" /* +v (channel voice) */ #include "modes/cmode_v.h" -/* +s (server notices) */ -#include "modes/umode_s.h" /* +w (see wallops) */ #include "modes/umode_w.h" /* +i (invisible) */ #include "modes/umode_i.h" /* +o (operator) */ #include "modes/umode_o.h" -/* +n (notice mask - our implementation of snomasks) */ +/* +n (server notice masks) */ #include "modes/umode_n.h" ModeHandler::ModeHandler(InspIRCd* Instance, char modeletter, int parameters_on, int parameters_off, bool listmode, ModeType type, bool operonly, char mprefix, char prefixrequired) @@ -1202,7 +1200,6 @@ ModeParser::ModeParser(InspIRCd* Instance) : ServerInstance(Instance) new ModeChannelOp(Instance), new ModeChannelHalfOp(Instance), new ModeChannelVoice(Instance), - new ModeUserServerNotice(Instance), new ModeUserWallops(Instance), new ModeUserInvisible(Instance), new ModeUserOperator(Instance), diff --git a/src/modes/Makefile b/src/modes/Makefile index e88bcd002..682e554b5 100644 --- a/src/modes/Makefile +++ b/src/modes/Makefile @@ -1,14 +1,11 @@ CC = i am cornholio CXXFLAGS = -I../../include ${FLAGS} -all: umode_w.o umode_s.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o modeclasses.a +all: umode_w.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o modeclasses.a umode_w.o: umode_w.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_w.cpp -umode_s.o: umode_s.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h - @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_s.cpp - umode_o.o: umode_o.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c umode_o.cpp @@ -54,7 +51,7 @@ cmode_h.o: cmode_h.cpp ../../include/base.h ../../include/modules.h ../../includ cmode_b.o: cmode_b.cpp ../../include/base.h ../../include/modules.h ../../include/inspircd.h ../../include/channels.h ../../include/users.h ../../include/inspircd_config.h ../../include/mode.h @../../make/run-cc.pl $(CC) -pipe -I../../include $(FLAGS) -export-dynamic -c cmode_b.cpp -modeclasses.a: umode_w.o umode_s.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o +modeclasses.a: umode_w.o umode_o.o umode_n.o umode_i.o cmode_v.o cmode_t.o cmode_s.o cmode_p.o cmode_o.o cmode_n.o cmode_m.o cmode_l.o cmode_k.o cmode_i.o cmode_h.o cmode_b.o @-rm -rf modeclasses.a @../../make/run-cc.pl ar crs modeclasses.a *.o diff --git a/src/modes/umode_n.cpp b/src/modes/umode_n.cpp index ee3fe09b3..878de8097 100644 --- a/src/modes/umode_n.cpp +++ b/src/modes/umode_n.cpp @@ -17,7 +17,7 @@ #include "users.h" #include "modes/umode_n.h" -ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, 'n', 1, 0, false, MODETYPE_USER, true) +ModeUserServerNoticeMask::ModeUserServerNoticeMask(InspIRCd* Instance) : ModeHandler(Instance, 's', 1, 0, false, MODETYPE_USER, true) { } @@ -36,13 +36,6 @@ ModeAction ModeUserServerNoticeMask::OnModeChange(User* source, User* dest, Chan parameter = dest->ProcessNoticeMasks(parameter.c_str()); dest->modes[UM_SNOMASK] = true; - if (!dest->modes[UM_SERVERNOTICE]) - { - std::vector<std::string> newmodes; - newmodes.push_back(dest->nick); - newmodes.push_back("+s"); - ServerInstance->Modes->Process(newmodes, source, true); - } return MODEACTION_ALLOW; } else diff --git a/src/modes/umode_s.cpp b/src/modes/umode_s.cpp deleted file mode 100644 index 6b6e521eb..000000000 --- a/src/modes/umode_s.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* +------------------------------------+ - * | Inspire Internet Relay Chat Daemon | - * +------------------------------------+ - * - * InspIRCd: (C) 2002-2008 InspIRCd Development Team - * See: http://www.inspircd.org/wiki/index.php/Credits - * - * This program is free but copyrighted software; see - * the file COPYING for details. - * - * --------------------------------------------------- - */ - -#include "inspircd.h" -#include "mode.h" -#include "channels.h" -#include "users.h" -#include "modes/umode_s.h" - -ModeUserServerNotice::ModeUserServerNotice(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 's') -{ -} - -unsigned int ModeUserServerNotice::GetCount() -{ - return count; -} diff --git a/src/snomasks.cpp b/src/snomasks.cpp index e4c02057f..64a331b2e 100644 --- a/src/snomasks.cpp +++ b/src/snomasks.cpp @@ -135,7 +135,7 @@ void Snomask::Flush() for (std::list<User*>::iterator i = ServerInstance->Users->all_opers.begin(); i != ServerInstance->Users->all_opers.end(); i++) { User* a = *i; - if (IS_LOCAL(a) && a->IsModeSet('s') && a->IsModeSet('n') && a->IsNoticeMaskSet(MySnomask) && !a->quitting) + if (IS_LOCAL(a) && a->IsModeSet('s') && a->IsNoticeMaskSet(MySnomask) && !a->quitting) { a->WriteServ("NOTICE %s :*** %s: %s", a->nick.c_str(), this->Description.c_str(), this->LastMessage.c_str()); |